Mail Archives: djgpp/1996/11/28/16:26:29
Problems with DJGPP V2.01 - atof() function
Hi!
Recently I've made an upgrade of my application from V1.xx
to V2.01 of DJGPP. In V1.xx my application is working properly.
After all the corrections I made in source files, due to
the changes in DJGPP Include files, I finally obtained an
executable file. But, when I tried to execute it, I got a crash
of my application! I made a debug and I found the cause of my
crash that is an incorrect return of atof() function. I'm using
it as in the example below:
char string[]="1.13";
int result;
...
result = (int)(atof(string)*100);
...
I've got result = 112!!! not 113 as I wished, because
the function atof() return is 1.29999... not 1.13 (and I only have
an old i386).
I think that problem is a bug of DJGPP Library V2.xx.
Has someone noticed that problem and corrected it? If they
have, please let me know about it.
Tanks in advance!
Ernesto R. Afonso
Inesc - Aveiro Portugal
e-Mail: afonso AT inesca DOT inesca DOT pt
- Raw text -