擅长:python、mysql、java
<p>在二进制64浮点表示的精度范围内,这些值相等:</p>
<pre><code>In [21]: 0.6931471805599453094172321214581 == 0.693147180559945286227
Out[21]: True
</code></pre>
<p><code>0.693147180559945286227</code>是将ln(2)最精确的可表示近似值存储到一个64位浮点中,然后将其打印到那么多个数字。尝试在浮点中填充更多的数字只会使结果四舍五入到相同的值:</p>
^{pr2}$
<p>至于他们为什么在代码中写<code>0.693147180559945286227</code>,你得问问1993年在Sun上写<a href="http://www.netlib.org/fdlibm/e_acosh.c" rel="nofollow noreferrer">FDLIBM</a>的人。这个代码来自FDLIBM。在</p>