bug-glibc
[Top][All Lists]
Advanced

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

round function


From: Ricardo Fabbri
Subject: round function
Date: Thu, 7 Mar 2002 16:48:20 -0300 (BRT)

Hi,

I have a problem with the new ISO C99 "round" function.
It doesn't seem to be working. When I compile and run the program
below, the result is a nonsense number.

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

main()
{
    printf("%f\n",round(4.5));
    return 0;
}
/*---------------------------------*/

bash$ gcc -o tmp tmp.c -lm

bash$ ./tmp

2.906845  (output)


My system specs:

LINUX KERNEL 2.4.14, LIBC 2.2.3, GCC 2.95.3.

thanks in advance,
and sorry if I'm making any stupid mistake...
Ricardo.

-- 
=================================================
                 RICARDO FABBRI
 >> Cybernetic Vision Research Group - CVRG/IFSC
        http://cyvision.if.sc.usp.br
 >> 4th year Computer Science Undergraduate ICMC
        USP - Campus Sao Carlos  (Brazil)
 >> HOME PAGE:
      http://cyvision.if.sc.usp.br/~rfabbri
         Linux Registered User #175401
=================================================




reply via email to

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