- 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?

29th Aug 2017, 5:40 PM
Jordan Maurice Wofford
Jordan Maurice Wofford - avatar
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
29th Aug 2017, 6:36 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar