c++ how to get “one digit exponent” with printf

后端 未结 5 2160
说谎
说谎 2020-12-06 05:48

Is there a way to print in scientific notation less than 3 places for exponent part of number? The 6.1 formatting doesn\'t affect exponent but only the number part:

5条回答
  •  甜味超标
    2020-12-06 06:19

    According to Wikipedia:

    The exponent always contains at least two digits; if the value is zero, the exponent is 00. In Windows, the exponent contains three digits by default, e.g. 1.5e002, but this can be altered by Microsoft-specific _set_output_format function.

    _set_output_format

提交回复
热议问题