www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/28/16:26:29

From: afonso AT inesca DOT inesca DOT pt
Newsgroups: comp.os.msdos.djgpp
Subject: Problems with DJGPP V2.01 - atof() function
Date: Fri, 29 Nov 1996 04:49:09 GMT
Organization: Inesc - Aveiro Portugal
Lines: 35
Message-ID: <329e68a5.10316617@news.ua.pt>
Reply-To: afonso AT inesca DOT inesca DOT pt
NNTP-Posting-Host: inside.inesca.pt
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

       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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019