Bugs item #10713, was opened at 2007-05-09 09:12
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10713&group_id=426

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: john oordopjes (oordopjes)
Assigned to: Nobody (None)
Summary: Weird rounding behavior..

Initial Comment:
irb(main):002:0> n=4
=> 4
irb(main):003:0> a=(52.07825 * (10.0 ** n))
=> 520782.5
irb(main):004:0> a.round
=> 520782

Which is WRONG it should be 520783.
Using an other number:

irb(main):005:0> a=(52.07835 * (10.0 ** n))
=> 520783.5
irb(main):006:0> a.round
=> 520784

This is correct behavior.. really WEIRD isn't it?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10713&group_id=426