+ 1
Division in Ruby
I know Ruby allows division with the / symbol. But, for example, 5 / 2 is 2. If I want it to be 2.5, what symbol do I have to use?
2 Respostas
+ 8
#Use a floating point like
puts 5/2.0
#^_^
+ 1
Thanks!
I know Ruby allows division with the / symbol. But, for example, 5 / 2 is 2. If I want it to be 2.5, what symbol do I have to use?