Forum: Ruby Re: greatest float smaller than 1.0?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
67bb4df2775f6a6b603347dce7119571?d=identicon&s=25 unknown (Guest)
on 2006-05-18 00:11
(Received via mailing list)
If you look into some numerics book , like the one by Stoer and
Burlisch,
they introduce a convention of an epsilon as the smallest positive
number
that a computer can store.
This is of course machine/implementation dependent. I have tried to
find
whether there is a common Ruby definition - but I didn't find  anything,
maybe because Ruby introduces BigFloats along the way automatically.
In any case, this epsilon will be a power of 2.
On my machine, Float::EPSILON is 2**(-52).

(Just type in

Float::EPSILON

at irb).

Your computer can only represent integer multiples of that number as
floats, so there are all sorts of rounding errors  in  arithmetic - see
Stoer
and Burlisch
or _http://www.javaworld.com/javaworld/jw-10-1996/jw-1...
(http://www.javaworld.com/javaworld/jw-10-1996/jw-1...)  .

Best regards,

Axel
This topic is locked and can not be replied to.