discuss-gnustep
[Top][All Lists]
Advanced

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

Re: floor() is not working on my GNUstep/Solaris box


From: Nicola Pero
Subject: Re: floor() is not working on my GNUstep/Solaris box
Date: Mon, 17 Mar 2003 16:33:40 +0000 (GMT)

> Hi all,
> 
> can anybody explain why
> 
>        double mer = 12.23232;
>        int zahl = floor(mer);
>        NSLog(@"mer %f zahl %d", mer, zahl);
> 
> delivers the following output on my Solaris 8 / GNUstep box?
> 
> 2003-03-17 17:16:21.502 GPSService[15870] mer 12.232320 zahl 1076393714
> 
> What am I missing?

The first thing which comes to mind is ... did you #include <math.h> ?

If not, then the floor() prototype might be missing.

The compiler might then compile with the assumption that floor() takes an
int and returns an int, adding implicit conversions from double etc, and
spoiling everything.





reply via email to

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