[Top][All Lists]

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

Re: Float problems with trunc() and round()

From: Justin Guyett
Subject: Re: Float problems with trunc() and round()
Date: Wed, 3 Oct 2001 13:08:14 -0700 (PDT)

On 3 Oct 2001, Andreas Schwab wrote:

> Kjeld Borch Egevang <address@hidden> writes:
>> I suppose the functions trunc() and round() should do something
>> similar to ceil() and floor(). When I try this on my i686-linux, it
>> seems to be broken. Here is my test:
> Your test is broken.

(glibc 2.2.4, i686-pc-linux-gnu, 2.4.9-ac3, gcc 2.95.3)

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

int main(int argc, char **argv)
   printf("%f %f\n", truncf(1000.250), roundf(1000.501));

% gcc -o t1 -lm test.c
% ./t1
0.000000 2.086854

looks broken to me, but maybe i'm forgetting something


reply via email to

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