We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extends
super
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
可以用来测试浮点数运算结果是否相等
const n = 0.1 + 0.2 n - 0.3 < Number.EPSILON // true,可以认为 n 与 0.3近似相等
在IEEE 754-2019中的双精度二进制表示形式中,最小的可能值是非规范化值。如果实现不支持非规范化值,那么 Number.MIN_VALUE 必须是实现能表示的最小的非0正数。
属性描述符为 { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
-∞
Number.NEGATIVE_INFINITY === -Infinity // true
+∞
Number.POSITIVE_INFINITY === Infinity // true
Number
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Number 对象
Number构造器
extends
子句的值。打算继承指定的 Number 行为的子类构造函数必须包括对 Number 构造函数的super
调用,以创建和初始化具有内置插槽 [[NumberData]] 的子类实例。Number ( value )
Number 构造器上的属性
Number.EPSILON
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
Number.MAX_SAFE_INTEGER
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
Number.MAX_VALUE
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
Number.MIN_SAFE_INTEGER
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
Number.MIN_VALUE
在IEEE 754-2019中的双精度二进制表示形式中,最小的可能值是非规范化值。如果实现不支持非规范化值,那么 Number.MIN_VALUE 必须是实现能表示的最小的非0正数。
属性描述符为
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
Number.NaN
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
Number.NEGATIVE_INFINITY
-∞
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
Number.POSITIVE_INFINITY
+∞
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
Number.prototype
Number.isFinite ( number )
Number
类型,返回 falseNumber.isInteger ( number )
Number.isNaN ( number )
Number
类型,返回 falseNumber.isSafeInteger ( number )
Number.parseFloat ( string )
Number.parseInt ( string, radix )
Number 原型对象属性见下章
The text was updated successfully, but these errors were encountered: