Subject: Re: Amendment to post: atof() bug in b17.1 & b18?
From: [email-masked] ("Michael A. Benzinger")

14 Jun 1997 19:58:56 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Sender: [email-masked]
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
Original-To: [email-masked], gnu-win32 mailing list <[email-masked]>
In-Reply-To: <[email-masked]>
Original-Sender: [email-masked]

Ewen,

You need to #include stdlib.h at the top
of your program.  I got the same results
compiling your program as listed below.
When I added stdlib.h, the results were
as expected.  I am assuming here that
the atof routine is not be compiled and
called properly.

Mike Benzinger

At 11:24 AM 6/13/97 +0100, E. Dennis wrote:
>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
>"[email-masked]" with one line of text: "help".
>
>

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".