From: Thiago Massa Date: 2009-11-30T03:14:39+09:00 Subject: Re: Just found a round problem --000e0cd66998fed2270479866743 Content-Type: text/plain; charset=ISO-8859-1 In C i think its 14/15 significant digits and its probably why. If you want that much precision, find a way to use a bigger float. On Sun, Nov 29, 2009 at 3:34 AM, Ruby Newbee wrote: > Thanks all~ > > 2009/11/29 Steve Wilhelm : > > Florian Gilcher wrote: > > > >> On Nov 29, 2009, at 12:06 AM, Ruby Newbee wrote: > >> > >>> irb(main):026:0> 10.499999999999999.round > >>> => 10 > >>> irb(main):027:0> 10.4999999999999999.round > >>> => 11 > >>> > >>> > >>> Does this happen due to the float problem in any languages including > >>> ruby? > >>> Thanks. > >> > >> > >> Thats IEEE 754 float behaviour, yes. python behaves exactly the same. > >> > > >> > > > > And PHP 5 as well. > > > > -- Horofox @ irc.freenode.net | #ruby, #ubuntu & #rails Thiago Fernandes Massa 11 83979414 --000e0cd66998fed2270479866743--