From: GOTO Kentaro Date: 2002-09-14T04:42:32+09:00 Subject: Re: float precision At Sat, 14 Sep 2002 02:54:56 +0900, Daniel Bretoi wrote: > irb(main):001:0> a = 20020912.194220 > 20020912.19 > > Why do I miss the last 5 digits when I try to assign a? Those were omitted by Float#inspect method. irb calls #inspect for each result and reports that without quote. a = 20020912.194220 a == 20020912.19 #=> false a == 20020912.194220 #=> true Give format and you will get all digits: irb(main):001:0> a = 20020912.194220 20020912.19 irb(main):002:0> sprintf("%.6f", a) "20020912.194220" ieee754hack.rb explains more details of internal representation: http://www.notwork.org/~gotoken/ruby/p/as-is/ieee754hack.rb -- Gotoken