mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-28 21:02:56 +08:00
deploy
This commit is contained in:
@ -1720,6 +1720,10 @@
|
||||
</ol>
|
||||
<p>其它整数类型 byte, short, long 取值范围的计算方法与 int 类似,在此不再赘述。</p>
|
||||
<h3 id="_2">浮点数表示方式 *<a class="headerlink" href="#_2" title="Permanent link">¶</a></h3>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<p>在本书中,标题后的 <code>*</code> 符号代表选读章节,如果你觉得理解困难,建议先跳过,等学完必读章节后续再单独攻克。 </p>
|
||||
</div>
|
||||
<p>细心的你可能会疑惑: int 和 float 长度相同,都是 4 bytes ,<strong>但为什么 float 的取值范围远大于 int</strong> ?按说 float 需要表示小数,取值范围应该变小才对。</p>
|
||||
<p>其实,这是因为浮点数 float 采用了不同的表示方式。IEEE 754 标准规定,32-bit 长度的 float 由以下部分构成:</p>
|
||||
<ul>
|
||||
|
Reference in New Issue
Block a user