Re: floating point on Nevada cpu

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

 



On Wed, 24 Jan 2001, Pete Popov wrote:

> Looks like there's something more basic that fails here.  This:
> 
> #include <stdio.h>
> int main()
> {
>     float x1,x2,x3,x4,x5;
> 
>     x1 = 7.5;
>     x2 = 2.0;
>     x3 = x1/x2;
>     x4 = x1*x2;
>     x5 = x1-x2;
>     printf("x1 %f x2 %f x3 %f x4 %f x5 %f\n", x1, x2, x3, x4, x5);
> }
> 
> 
> produces this:
> 
> sh-2.03# ./fl 
> x1 0.000000 x2 0.000000 x3 0.000000 x4 0.000000 x5 0.000000
> 

Try this:

int main()
{
	printf("%f\n", (float)3.14159);
}

If *that* fails, check your libraries and make sure the calling conventions,
etc. match what you think they should be...

-Justin


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux