| www.delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
| X-Recipient: | djgpp AT delorie DOT com |
| From: | "Gerrit van Niekerk" <gerritvn AT gpvno DOT co DOT za> |
| Organization: | GPvNO |
| To: | djgpp AT delorie DOT com |
| Date: | Mon, 17 Dec 2007 23:27:07 +0200 |
| MIME-Version: | 1.0 |
| Subject: | Re: V2.04 atof() with em387.dxe not working |
| Message-ID: | <476705CB.16539.264EBE5@gerritvn.gpvno.co.za> |
| X-Confirm-Reading-To: | gerritvn AT gpvno DOT co DOT za,gpvno AT telkomsa DOT net |
| X-pmrqc: | 1 |
| In-reply-to: | <0ab65951-727f-4072-b08a-844c374e2647@1g2000hsl.googlegroups.com> |
| References: | <476126B6 DOT 22072 DOT 1F8A1AB AT gerritvn DOT gpvno DOT co DOT za>, <0ab65951-727f-4072-b08a-844c374e2647 AT 1g2000hsl DOT googlegroups DOT com> |
| X-mailer: | Pegasus Mail for Windows (4.41) |
| Reply-To: | djgpp AT delorie DOT com |
| Errors-To: | nobody AT delorie DOT com |
| X-Mailing-List: | djgpp AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie DOT com |
> On 15 Dec 2007 at 9:28, rugxulo AT gmail DOT com wrote:
> Can you post your example (or a simplified version at least) or even an .EXE?
Here is a simple example which shows the problem. Of course you have to run it on
a machine without a floating point unit by setting emu387:
set emu387=c:/emu387.dxe
// FPTEST.C
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
double dfVal;
char *psz = "1.23";
dfVal = atof(psz);
printf("String %s Floating value %f\n",psz,dfVal);
return 0;
}
Here are the results I got:
C:\>set emu387=c:/emu387.dxe
C:\>fptest
String 1.23 Floating value 0.000000
C:\>set emu387=c:/wmemu387.dxe
C:\>fptest
String 1.23 Floating value 1.230000
C:\>
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |