[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

why Float::MIN? is positive

meruby

3/28/2005 8:10:00 PM

Shouldn't Float::MIN = -Float::MIN?

2 Answers

meruby

3/28/2005 8:33:00 PM

0

Sorry for typo in previouse post:
Shouldn't Float::MIN = -Float::MAX

Charles Mills

3/28/2005 10:04:00 PM

0


meruby@gmail.com wrote:
> Sorry for typo in previouse post:
> Shouldn't Float::MIN = -Float::MAX

Float::MIN is the smallest number > 0 that can be represented by a
Float. Usefull I guess if you need to represent really small values.

Float objects are basically a wrapper around a C double.

on my system it is:

irb(main):001:0> Float::MIN
=> 2.2250738585072e-308

which is in the float.h header as
#define __DBL_MIN__ 2.2250738585072014e-308

-Charlie