<p>从python文档中:</p>
<blockquote>
<p>'e' Exponent notation. Prints the number in scientific notation using the letter ‘e’ to indicate the exponent. The default precision is 6.</p>
</blockquote>
<hr/>
<blockquote>
<p>'g'<br/>
General format. For a given precision p >= 1, this rounds the number to p significant digits and then formats the result in either fixed-point format or in scientific notation, depending on its magnitude.</p>
<p>The precise rules are as follows: suppose that the result formatted with presentation type 'e' and precision p-1 would have exponent exp. Then if -4 <= exp < p, the number is formatted with presentation type 'f' and precision p-1-exp. Otherwise, the number is formatted with presentation type 'e' and precision p-1. In both cases insignificant trailing zeros are removed from the significand, and the decimal point is also removed if there are no remaining digits following it.</p>
<p>Positive and negative infinity, positive and negative zero, and nans, are formatted as inf, -inf, 0, -0 and nan respectively, regardless of the precision.</p>
<p>A precision of 0 is treated as equivalent to a precision of 1. The default precision is 6.</p>
</blockquote>
<p>其他值:</p>
<pre><code>>>> "%.3e" % 123
'1.230e+02'
>>> "%.3g" % 123
'123'
>>> "%.3e" % 1234
'1.234e+03'
>>> "%.3g" % 1234
'1.23e+03'
</code></pre>
<p>那么精确性是如何明确规定的。<code>g</code>似乎使用精度作为精度的常规定义,而{<cd2>}使用小数点后的位数。在</p>