From: Stefano Taschini Date: 2006-05-18T15:24:40+09:00 Subject: Re: greatest float smaller than 1.0? Hi, The right answer is that of Mauricio 1 - Float::EPSILON/2 corresponding to a significand of all ones and an effective exponent of -1. 1.0 - Float::EPSILON does have an exponent of -1 but the LSB of the significand is 0: [1 - Float::EPSILON/2].pack("G").unpack("B*") # => ["0011111111101111111111111111111111111111111111111111111111111111"] [1 - Float::EPSILON].pack("G").unpack("B*") # => ["0011111111101111111111111111111111111111111111111111111111111110"] On 18/05/06, Logan Capaldo wrote: > > On May 17, 2006, at 4:55 PM, polypus wrote: > > > > > how do i get the greatest float smaller than 1.0? > > > > thanks > > > > -- > > Posted via http://www.ruby-forum.com/. > > > > 1.0 - Float::EPSILON > > >