From: Sebastian Hungerecker Date: 2008-01-24T00:31:54+09:00 Subject: Re: Floating point conversion error? Brandon Hoult wrote: > >> (2241.18 * 100).to_i > > => 224117 > > Anyone know what is up with that? Floating point arithmetic isn't entirely accurate. >> "%.30f" % (2241.18 * 100) => "224117.999999999970896169543266296387" And since 224117.999999999970896169543266296387.to_i is 224117, that's what you get. HTH, Sebastian -- NP: Immortal - Withstand The Fall Of Time Jabber: sepp2k@jabber.org ICQ: 205544826