[ODE] What is the ODE approach to denormals?
GARY VANSICKLE
g.r.vansickle at worldnet.att.net
Tue Apr 27 21:38:31 MST 2004
> Ah, but those aren't what we actually want.
Wha-huh? According to one (admittedly rather old and crusty but AFAIK still
valid) source:
"static T
min ();
Returns the minimum finite value. For floating point types with
denormalization, min() must return the minimum normalized value."
"minimum normalized value", that's exactly what we want, isn't it?
> 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.
Well <float>::min() will give you a number with an exponent of 0, so isn't
the same mantissa with an exponent of -1 the
(almost-)denormal-if-you-square-it number we seek? Assuming a
numeric_limits::radix of 2 of course.
> 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.
>
I prefer that my magic epsilons contain as little magic as possible ;-).
> 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? :-)
>
Gotta disagree with you there. Say the instance in question works fine with
the minimum non-denormal. Nothing says the next "> 0", even if it should be
an epsilon, would work with the same value. That would have to be evaluated
on a case-by-case basis.
More information about the ODE
mailing list