Stefan C. Müller a écrit :
> * Replaced an rint() call with floor() (MSVC does not offer rint).
I am a bit worried that floor and rint are not the same. I don't know if
it matters in this context but how about using the code below instead ?
// round double to 10^g
double rnd(double r, int g = 0)
{
double f = pow(10.0, g);
double n = r / f;
n += ( n < 0 ) ? -.5 : .5;
return f * floor( n );
}
-Fred
--
Frédéric Bouvier
http://my.fotolia.com/frfoto/ Photo gallery
http://fgsd.sourceforge.net/ FlightGear Scenery Designer
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel