red floyd wrote:
MJKUOG wrote:
>Hi,
I am wondering how many digits after '0' does double keeps.
"After '0'"? Do you mean after decimal point?
Is there
>anyway to increase it if it is not big enough in special cases?
Thanks,
MJKUOG
Assuming IEEE-754, you have a 52-bit mantissa. Work from there.
There is no need to assume anything. Use the value of
std::numeric_limits<double>::digits10 to find out the total
representable decimal positions, then subtract the number of
digits before the decimal point, if that's truly what you're
after.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask