From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2006-03-17 10:12:48
On 3/17/06, Paul A Bristow <pbristow_at_[hidden]> wrote:
> Ooops - this is a typo.
> It should of course be 3010/10000.
Which is one of the reasons magic numbers in code are best avoided. It sure
would be nice if one could just use numeric_limits<T>::digits10 + 2 instead
of numeric_limits<T>::digits * 3010 / 10000, but the former gives a
different result for float (8 instead of 9).
Perhaps this cryptic calculation might be best addressed by a
boost::numeric_limits<T> which could extend std::numeric_limits<T> and
include Paul Bristow's proposed max_digits10 (see
-- Caleb Epstein caleb dot epstein at gmail dot com