Scary!
irb(main):019:0 (0.57 * 100).to_i
= 56
irb(main):020:0 (0.58 * 100).to_i
= 57
This is totally out of my understanding Will look into core... seems
like some bug...
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google
(0.29*100).to_s.to_i will return what you expect.
On Mar 31, 10:27 am, Jimish Jobanputra li...@ruby-forum.com wrote:
Scary!
irb(main):019:0 (0.57 * 100).to_i
= 56
irb(main):020:0 (0.58 * 100).to_i
= 57
This is totally out of my understanding Will look into core... seems
like some
Nm... this explains it:
http://rubypond.com/blog/when-ruby-floating-just-isn-t-good-enough
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send email to
3 matches
Mail list logo