If I recall, there are several ways to tell ruby that a number or result is a float, otherwise you get some odd calculation results:
x = 5
=> 5
x / 2
=> 2
x / 2.0
=> 2.5
x / 2.to_f
=> 2.5
Dividing 5 by 2 initially gives a result of 2 as it is dealing in integers (both the inputs are integers). Clearly that is wrong, so you need to ensure one part of the equation is using float.
This can be achieved by adding some decimalisation (as you did above), or calling the ‘to_f’ method on the number with a period/full-stop.
I think you only need one part of the calc to be a float so have a play around with it.
Are you familiar with exercise 3 in the ruby course? I’m wondering if there is another way that I was supposed to figure out, or if Zed meant for me to just use floats when I wrote the code.