问题
http://en.wikipedia.org/wiki/Double-precision_floating-point_format say that double can handle 16 digits of precision to the right part of the number, is digits10 show this number ?
回答1:
Actually it's just the number of meaningful digits. Point. You can have 12345678901234.5 or 0.0000123456789012345.
回答2:
std::numeric_limits<T>::digit10 is the number of decimal digits you can get back when converting a string with a decimal value to T and back to a string again. The count starts at the most significant non-zero digit, independent of where the decimal point is located (as long as you don't conflict with the range restrictions of T, of course). That is, leading and trailing zeros don't matter.
来源:https://stackoverflow.com/questions/13103304/stdnumeric-limitsdoubledigits10-number-of-digits-on-the-right-or-left-to