[kaffe] Re: The problem of "Double.c and buggy strtod" is settled

Dalibor Topic robilad at yahoo.com
Thu Jun 5 09:00:01 PDT 2003


--- Ito Kazumitsu <kaz at maczuka.gcd.org> wrote:
> >>>>> "*" == Ito Kazumitsu <kaz at maczuka.gcd.org> writes:
> 
> *> In fact, FreeBSD 4.7-RELEASE's /usr/include/float.h says
> *> #define DBL_MIN         2.2250738585072014E-308
> *> and replace/strtod.c says, when HAVE_FLOAT_H is undefined,
> *> almost the same thing:
> *> # define DBL_MIN 2.2250738585072010e-308
> *> I remember Linux 2.0.x's float.h also defines something like this.
> *> 
> *> So Java's double MIN_VALUE 4.9406564584124654418e-324 will be
> *> considered to be 0.0 by this strtod.c.
> 
> Studying this issue further,  I found that DBL_MIN is not the only
> factor that makes strtod convert 4.9406564584124654418e-324 to 0.0.
> 
> Even if I comment out 
>        if (num < DBL_MIN * pow (10.0, (double) -exponent))
>         goto underflow;
> this strtod converts 4.9406564584124654418e-324 to 0.0 although
> errno is not set.
> 
> Inserting "printf("## num, exp = %f, %d\n", num, exponent);"
> before "num *= pow (10.0, (double) exponent);",  I get
> "## num, exp = 49406564584124661760.000000, -343".  So
> the reason why 4.9406564584124654418e-324 becomes 0.0
> seems to be the limitation of the function pow().

o.k., since the strtod from libit doesn't work, the one from libiberty (gcc)
doesn't work either, I'll see if I can get the one from NetBSD to work, since
you've had some success with it. 

cheers,
dalibor topic

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com




More information about the kaffe mailing list