[ODE] What is the ODE approach to denormals?
Jon Watte
hplus-ode at mindcontrol.org
Tue Apr 27 12:15:39 MST 2004
Ah, but those aren't what we actually want. Especially for the denormal-if-you-square-it number. For numerical precision reasons, using <float>::min and taking sqrt() of it won't cut it. And, in addition, because I'm a little bit superstitious magic epsilons, I prefer for these epsilons to be slightly bigger than the absolutely minimum representable number.
Anyway, there are zillions of places where ODE compares "> 0" where it should compare "> some_epsilon" -- identifying all of them is the hard part. Figuring out the value of the epsilon is just a matter of preference. (degrees or radians in XML, anyone? :-)
Cheers,
/ h+
-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of GARY
VANSICKLE
Sent: Monday, April 26, 2004 8:19 PM
To: ode at q12.org
Subject: RE: [ODE] What is the ODE approach to denormals?
> I dare you to show me one machine except for the playstation series
> where "float" does not have 8 bits of exponent, and "double" does
> not have 11 bits of exponent. Actually, playstation has floats, but
> not denormals as we know them, so it's even more important to avoid
> them.
>
> I'm fine with using a #define for the constants that I hard-coded
> here, but the names become quite confusing. Something like:
>
> dRealDenormalEpsilon // this is about the smallest representable
> // number that won't go denormal
> dRealDenormalEpsilonSqrt // this is about the smallest number
> // which won't go denormal when squared
>
> There are no standard header values that you can use,
Actually there is:
numeric_limits<float>::min( )
numeric_limits<double>::min( )
...etc.
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode
More information about the ODE
mailing list