
Wyatt G. answered 12/27/20
Tutor
New to Wyzant
Software Engineer and Architect Specializing in Ruby on Rails
In Ruby, if both numbers are integers, integer division is performed. To get floating point division, cast one of the numbers to a float like this:
9 / 5.0
or if you have variables:
x.to_f / y