How can I find the maximium number of decimal digits representable in a double?

Mar 14, 2023 at 7:08am
What is the maximum precision of double?

numeric_limits<double>::?????

default precision is 6 digits after the period
Last edited on Mar 14, 2023 at 7:10am
Mar 14, 2023 at 7:12am
Wikipedia wrote:
The 53-bit significand precision gives from 15 to 17 significant decimal digits precision
https://en.wikipedia.org/wiki/Double-precision_floating-point_format

Note that it's talking about significant digits, not digits after the decimal separator.

If you print more digits than this you cannot expect them to be accurate.
Mar 14, 2023 at 7:15am
how can this be obtained from numeric_limits<double> ?
Mar 14, 2023 at 7:16am
Topic archived. No new replies allowed.