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

Re: Q: fp problems with glibc on debian arm



On Mon, Jun 11, 2001 at 09:44:04AM +0200, Tilman Schoop wrote:
> I have installed a debian ARM distribution (2.2 potato)
> on my arm sa1100 board.
> Seems to run as far. But I have a problem with the glibc
> which is included in the distribution.
> The function atof does not work!
> 
> A small test program containing the following lines:
> 
>     value = atof("1.0");
>     printf("atof: str \"1.0\" --> value %f\n", value);
>  
>     value = atof("-1.0");
>     printf("atof: str \"-1.0\" --> value %f\n", value);
> 
> writes:
> atof: str "1.0" --> value -1.998966
> atof: str "-1.0" --> value -1.998966
> 
> 
> instead of:
> atof: str "1.0" --> value 1.000000     
> atof: str "-1.0" --> value -1.000000
> 
> Does anyone know what is wrong here? Is there a configuration
> fault in my system? or do I have to recompile the glibc and
> substitute the one of the distribution?

You probably didn't include stdlib.h and forgot to compile with the
-Wall compiler flag so gcc didn't warn about implicit function
declarations. I can get the same strange behaviour on an ix86 system
when I don't include stdlib.h.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/



Reply to: