From: Jan Dvorak Date: 2008-09-12T07:20:01+09:00 Subject: Re: Array#pack and String#unpack query On Thursday 11 September 2008 19:59:39 Anton Hörnquist wrote: > > [1.0, 0.75, 0.5, 0.100000001490116, 0.025000000372529, > > 0.00999999977648258] > > [1.0, 0.75, 0.5, 0.1, 0.025, 0.01] > > > > How come? Read http://en.wikipedia.org/wiki/IEEE-754 about how floating point numbers are stored. 32-bit float doesn't have enough precision to store 0.1's bitpattern. That is why you should never compare floating point numbers directly. Jan