delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/06/13/15:54:17

From: e DOT dennis AT pemail DOT net ("E. Dennis")
Subject: Amendment to post: atof() bug in b17.1 & b18?
13 Jun 1997 15:54:17 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <33A11FF7.1408CC00.cygnus.gnu-win32@pemail.net>
Reply-To: e DOT dennis AT pemail DOT net
Mime-Version: 1.0
X-Mailer: Mozilla 4.0 [en] (WinNT; I)
Original-To: gnu-win32 mailing list <gnu-win32 AT cygnus DOT com>
X-Priority: 3 (Normal)
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Hi.  Yes, more info.  Sorry.

Example code follows:

main()
{
 float tst1, tst2, tst3, tst4, tst5;
 char ctst1[] = "0.5",
      ctst2[] = "0.0",
      ctst3[] = "60.00",
      ctst4[] = "60.50",
      ctst5[] = "1.011";


 tst1 = atof(ctst1);
 tst2 = atof(ctst2);
 tst3 = atof(ctst3);
 tst4 = atof(ctst4);
 tst5 = atof(ctst5);

 printf("%s = %f\n", ctst1, tst1);
 printf("%s = %f\n", ctst2, tst2);
 printf("%s = %f\n", ctst3, tst3);
 printf("%s = %f\n", ctst4, tst4);
 printf("%s = %f\n", ctst5, tst5);

return 1;
}

Output from my beta-18-compiled binary:

0.5 = 1.000000
0.0 = -49.000000
60.00 = 60.000000
60.50 = 1.000000
1.011 = 3.000000

Help?

Ewan Dennis,
Integrated Media Services,
Glasgow.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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