Float internal problem in ruby1.9.2dev (2009-07-18)
ruby 1.9.1 and earlier
ruby 1.9.2dev (2009-07-18) [i386-mswin32_90]
build this morning with VC++Express08
72.9 == 72.90000000000001
Is it just a problem with Float#to_s ?
Updated by Eregon (Benoit Daloze) about 11 years ago
Yeah, I know about the general problem of floats. Not the first time I got something unexpected.
I wouldn't wonder if it was the same behavior before.
But here it's different. It changed between 1.9.1 and 1.9.2. Why? I suppose the Float class didn't change so much.
Why on world then the Float#to_s changed?
And I think this issue is important, because you can't anymore round a Float to x decimal and show it in a shell, it will take 16digits instead of the 2+x expected...
Updated by shyouhei (Shyouhei Urabe) about 11 years ago
There was a discussion around Float's string representation after 1.9.1 was released.
This change is due to that.