Skip to content

Commit

Permalink
Update 2019-08-01.md
Browse files Browse the repository at this point in the history
  • Loading branch information
azl397985856 authored Nov 24, 2019
1 parent 7066ef3 commit a2099d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/daily/2019-08-01.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ JS中Number是双精度浮点型, 意味着可以表示的范围是2^63次方
JavaScript 的 Number 类型为 IEEE 754 64 位浮点类型。
最近出了 stage3 `BigInt` 任意精度数字类型,已经进入 stage3 规范。

JavaScript 的 Number 类型使用 53 位表示小数位,10 位表示指数位,1 位表示符号位。
因此指数部分最大值为`2^10 = 1024`
因此对于 Number 的范围,应该是 `2^1024`, 也就是`1.7976931348623157e+308`.
JavaScript 的 Number 类型使用 52 位表示小数位,11 位表示指数位,1 位表示符号位。
因此指数部分最大值为`2^11 - 1 = 2047`。当指数部分全部是1的时候,实际上表示的数字是`NaN,Infinite或者-Infinite`


因此对于 Number 的范围,应该是 `2^1024`,正数和负数各一半, 也就是`1.7976931348623157e+308`.

> 这个数字在计算器中是打印不出来的, 至于原因,大家自己想一下。
Expand Down

0 comments on commit a2099d6

Please sign in to comment.