- 1
If floats and integers are "different" in Ruby..how is it all to excite proper math calculations.
is 3.5 + 3.5= 7? or is 3.5=3 ; %5 blah blahbnkddjdvwvwimmm?
1 Antwort
0
3.5 + 3.5 = 7.0
Float and integers are different because they need a different way to be represented as binary numbers but calculating with both is allowed. In fact, doing
3.5 + 3 = 6.5
translate 3 from integer to float