[kaffe] Re: The problem of "Double.c and buggy strtod" is settled
Ito Kazumitsu
ito.kazumitsu@hitachi-cable.co.jp
Thu Jun 5 03:14:01 2003
In message "Re: The problem of "Double.c and buggy strtod" is settled"
on 03/06/05, Dalibor Topic <robilad@yahoo.com> writes:
> Attached is a patch that uses strtod.c from libit 0.7 and works for me on
> i686-linux 2.4. Could you give it a try, and see if it works on linux 2.0 as
> well?
I tried the attached strtod.c but it converts 4.9406564584124654418e-324
to 0.0 setting errno to 34(ERANGE). So I am afraid it is not usable
for libraries/clib/native/Double.c.
$ cat DoubleTest.c
#include <stdlib.h>
#include "strtod.c"
extern int errno;
int main(int argc, char* argv[]) {
double d = strtod(argv[1], NULL);
printf("%s %d %40.20e\n",argv[1], errno, d);
}
$ cc -o DoubleTest DoubleTest.c -lm
In file included from DoubleTest.c:2:
strtod.c:43: warning: `DBL_MAX' redefined
/usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/include/float.h:63: warning: this is
the location of the previous definition
strtod.c:44: warning: `DBL_MIN' redefined
/usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/include/float.h:54: warning: this is
the location of the previous definition
strtod.c:51: warning: `NULL' redefined
/usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/include/stddef.h:296: warning: this i
s the location of the previous definition
$ ./DoubleTest 4.9406564584124654418e-324
4.9406564584124654418e-324 34 0.00000000000000000000e+00