Re: issue using round () in gnome-mag

On Thu, 2006-04-20 at 20:04 -0300, Carlos Eduardo Rodrigues Diógenes
> Hi,
> I'm with an issue about using the round () function in gnome-mag. I must
> pass the option -std=c99 to the compiler and the -lm option to the
> linker to get the code working properly.
> One thing that I'm in doubt is if every compiler support the -std=c99
> option, I must care with it?

I always use "floor(x + 0.5)" for rounding, since this doesn't require
C99. The only difference is that it rounds halfway cases (xxx.5) upwards
instead of away from zero.

 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an old-fashioned day-dreaming rock star searching for his wife's true 
killer. She's a supernatural African-American widow with the power to bend 
men's minds. They fight crime! 

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