linux-mips
[Top] [All Lists]

Re: floating point on Nevada cpu

To: Pete Popov <ppopov@mvista.com>
Subject: Re: floating point on Nevada cpu
From: Justin Carlson <carlson@sibyte.com>
Date: Wed, 24 Jan 2001 19:16:04 -0800
Cc: "linux-mips@oss.sgi.com" <linux-mips@oss.sgi.com>
In-reply-to: <3A6F9814.3E39027@mvista.com>
Organization: Sibyte
References: <3A6F8F66.6258801@mvista.com> <0101241833281Q.00834@plugh.sibyte.com> <3A6F9814.3E39027@mvista.com>
Reply-to: carlson@sibyte.com
Sender: owner-linux-mips@oss.sgi.com
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

<Prev in Thread] Current Thread [Next in Thread>