0
5/2 = 2
x=5 y=2 #Division puts x/y #outputs 2 How come it could be "2"?
5 ответов
+ 2
i did a lil test and changed x=5 to x=5.0 and that worked.
+ 3
What do you mean you can't test it yourself?
+ 2
idk ruby but can you turn it into a float? Im guessing it drops the decimal.
+ 2
Thx a lot!
+ 1
You are dividing two ints and the result will be... another int. If you use floats then the result will be another float and won't get truncated.