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

Re: floor seems broken on potato on alpha



David Dula <ddula@alfomc.net> writes:

> int main()
> {
> 
> printf("%f\n",floor(0.100000));
> 
> }
> returns...
> 36028797018963968.000000
> 
> This breaks python bad when you sleep(.1)
> 
> I just updated today so I have all current stuff?
> 
> Any Ideas?

That code shouldn't compile. You forgot all include files.

----------------------------------------------------------------------
#include <stdio.h>
#include <math.h>

int main()
{
	printf("%f\n",floor(0.100000));
	return 0;
}
----------------------------------------------------------------------
$ gcc -W -Wall foo.c -lm

$ ./a.out
0.000000

$ uname -a
Linux alpha 2.2.5 #6 Fri Nov 3 00:26:07 CET 2000 alpha unknown

$ gcc -v
Reading specs from /usr/lib/gcc-lib/alpha-linux/2.95/specs
gcc version 2.95 19990728 (release)

----------------------------------------------------------------------

Works just fine for me.

May the Source be with you.
                        Goswin

PS: Why do i need -lm? Shouldn't gcc link that itself?


Reply to: