diff --git a/chapter_data_structure/data_and_memory/index.html b/chapter_data_structure/data_and_memory/index.html index 2414ada82..d9dbdc8de 100644 --- a/chapter_data_structure/data_and_memory/index.html +++ b/chapter_data_structure/data_and_memory/index.html @@ -1720,8 +1720,8 @@

其它整数类型 byte, short, long 取值范围的计算方法与 int 类似,在此不再赘述。

浮点数表示方式 *

-

细心的你可能会疑惑: int 和 float 长度相同,都是 4 bytes ,但为什么 float 的取值范围远大于 int ?这是因为浮点数 float 采用了不同的表示方式。

-

IEEE 754 标准规定,32-bit 长度的 float 由以下部分构成:

+

细心的你可能会疑惑: int 和 float 长度相同,都是 4 bytes ,但为什么 float 的取值范围远大于 int ?按说 float 需要表示小数,取值范围应该变小才对。

+

其实,这是因为浮点数 float 采用了不同的表示方式。IEEE 754 标准规定,32-bit 长度的 float 由以下部分构成: