Search:
Forum
General C++ Programming
How can I find the maximium number of de
How can I find the maximium number of decimal digits representable in a double?
Mar 14, 2023 at 7:08am UTC
JUANDENT
(411)
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 UTC
Mar 14, 2023 at 7:12am UTC
Peter87
(11235)
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 UTC
JUANDENT
(411)
how can this be obtained from numeric_limits<double> ?
Mar 14, 2023 at 7:16am UTC
Peter87
(11235)
https://en.cppreference.com/w/cpp/types/numeric_limits/digits10
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs