> > Unless you fly into someplace below sea level, where the floor of > > -0.01 is -1. > > And that's wrong? Why? > > Mild flame time: truncate-toward-zero is one of those things like > acos/asin/atan that you want to avoid like the plague. It has almost > no mathematical meaning (its output space is non-linear -- zero is > overrepresented) and gets you into trouble more often than not. > > What are we using it for? And why won't floor or ceil work instead? > The only "legitimate" use I can think of for trunc() on a negative > number is to emulate a FPU float to int conversion without going > through an integer register.
The only use for it, so far, is to extract the "thousands" value from the altitude for use in an altimeter digital "thousands" display. Trunc() will work fine for both positive and negative altitudes, but floor() won't. Mild flame time: It's an engineering solution, not a math problem. Dave -- **************************** David Culp davidculp2[at]comcast.net **************************** _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
