double

M

MJKUOG

Hi,
I am wondering how many digits after '0' does double keeps. Is there
anyway to increase it if it is not big enough in special cases?
Thanks,
MJKUOG
 
R

red floyd

MJKUOG said:
Hi,
I am wondering how many digits after '0' does double keeps. 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.
 
V

Victor Bazarov

"After '0'"? Do you mean after decimal point?
Is there

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top