For example:
9 / 5 #=> 1
but I expected 1.8. How can I get the correct decimal (non-integer) result? Why is it returning <
1.8
You can check it with irb:
$ irb >> 2 / 3 => 0 >> 2.to_f / 3 => 0.666666666666667 >> 2 / 3.to_f => 0.666666666666667