bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Serious weirdness in strtof


From: Ragnar Hojland Espinosa
Subject: Serious weirdness in strtof
Date: Thu, 12 Feb 2004 18:14:05 +0100
User-agent: Mutt/1.5.4i

glibc-2.3.2 (gentoo glibc-2.3.2-r9)

#include <stdlib.h>
main()
{
   printf ("%f\n", strtof ("+5.7344E+02", 0));
   return 0;
}

prints:
0.000000

and

#include <stdlib.h>
main()
{
   char foo;
   printf ("%f\n", strtof ("+5.7344E+02", 0));
   return 0;
}

prints:
245504.625029


as well as

glibc-2.3.3_pre20040207 (compiled with gcc 3.3.2-r7)
and on an old Red Hat Adv. Server 2.1 glibc-2.2.4-26

it does the same (with different numbers)

-- 
Ragnar Hojland - Project Manager
Linalco "Specialists in Linux and Free Software"
http://www.linalco.com  Tel: +34-91-4561700




reply via email to

[Prev in Thread] Current Thread [Next in Thread]