0
Float conversion in ruby
I'm starting Ruby and I saw that we have an automatic conversion. After writting a small programm it get me this: a=3 a+=0.3 puts a a+=0.3 puts a I get as a result 3.59999999996 Is there a reason why the addition between floats isn't working as intended? Thx in advance
2 Réponses
+ 7
https://www.sololearn.com/discuss/174005/?ref=app
https://www.sololearn.com/discuss/1137574/?ref=app
https://www.sololearn.com/discuss/1431710/?ref=app
https://www.sololearn.com/discuss/193246/?ref=app
https://www.sololearn.com/discuss/1852400/?ref=app
https://www.sololearn.com/discuss/1524665/?ref=app
https://www.sololearn.com/discuss/374762/?ref=app
https://www.sololearn.com/discuss/1344720/?ref=app
0
https://code.sololearn.com/WJgdN76zpwCE/?ref=app