[kaffe] MIN_VALUE of java.lang.Double

Kevin D. Kissell kevink at mips.com
Wed Oct 9 06:00:56 PDT 2002


The 1996 edition of the Java Language Spec calls out 5e-324
as java.lang.Double.MIN_VALUE, but the 1997 Java 1.0.2 
VM spec calls out 4.94065645841246544e-324 as the minimum
value for the JVM Double type.  So one can see how this sort
of discrepancy could have crept in. The problem arises from the
bad habit of expressing these values as decimal numbers,
rather than as binary mantissa/exponent pairs.  With a 53 bit mantissa
and an 11 bit exponent, one has a minimum binary value which
can be expressed in decimal as as something like 
4.9406564584124654e-324, but that's so tedious (and error-prone) 
to type that one frequently sees  it abbreviated and truncated to 
"4.94e-324" or "5e-324".   But those truncated values should not
be used in implementation!  The Second Edition (Java 2) JVM spec 
abandons the questionable use of decimal floating point notation,
and describes everything in terms of mantissa and exponent precision.  
I don't have the revised Java Language Specification handy to
see of they fixed it.  In any case, I believe that kaffe should be using 
the value that corresponds to the true minimum denormalized IEEE 
double.

            Regards,

            Kevin K.

----- Original Message ----- 
From: "Ito Kazumitsu" <ito.kazumitsu at hitachi-cable.co.jp>
To: <kaffe at kaffe.org>
Sent: Wednesday, October 09, 2002 1:10 PM
Subject: [kaffe] MIN_VALUE of java.lang.Double


> Kaffe's MIN_VALUE of java.lang.Double is
> 
>    4.9406564584124654418e-324
> 
> but can't this be changed to 5e-324?  This is the
> MIN_VALUE of GNU Classpath's java.lang.Double.
> 
> My machine's poor strtod converts 4.9406564584124654418e-324 to
> zero,  so make failes while compiling java/lang/Double.c.
> My machine's poor strtod seems to recognize 5e-324 as a non-zero
> value.
> 
> _______________________________________________
> kaffe mailing list
> kaffe at kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe
>




More information about the kaffe mailing list