I have read several topics about the display of floating point numbers display in C++ and I couldn't find a satisfying answer.
My question is: how to display all the significant digits of a floating point numbers in C++ in a scientific format (mantissa/exponent) ?
The problem is that all numbers do not have the same number of significant digits in base 10.
For example a double
has 15 to 17 significant decimal digits precision, but std::numeric_limits<double>::digits10
returns 15 and consequently, for some numbers I will loose 2 extra decimal digits of precision.