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

24th Aug 2019, 12:45 AM
Bal Gu
Bal Gu - avatar
2 Réponses