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
new
初始值为字符串 "Math"
属性描述符为 { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }
NaN
Math.acos(1) // 0 Math.acos(2) // NaN
Math.acosh(-Infinity) // NaN
Math.cbrt(NaN) // NaN Math.cbrt(+0) // +0 Math.cbrt(-0) // -0 Math.cbrt(+∞) // +∞ Math.cbrt(-∞) // -∞ Math.cbrt(null) // 0 Math.cbrt(0) // 0 Math.cbrt(2) // 1.2599210498948734 Math.cbrt(-Infinity) // -Infinity
-Math.floor(-x)
+0
-0
+∞
-∞
Math.ceil(-0.1) // -0 Math.ceil(null) // 0 Math.ceil() // NaN
-Math.ceil(-x)
Math.floor() // NaN Math.floor(NaN) // NaN Math.floor(null) // 0 Math.floor(0.9) // 0
0.1 + 0.2 === 0.3 // false Math.fround(0.1 + 0.2) === Math.fround(0.3) // true Math.fround(1.337); // 1.3370000123977661 Math.fround(1.337) === 1.337; // false
Math.max() // -Infinity Math.max(undefined) // NaN Math.max(NaN) // NaN Math.max(null) // 0 Math.max(0, -0) // 0
IEEE 754标准的默认模式是 最近舍入(舍入为最接近的偶数),它与四舍五入不同的是,对.5的舍入上采用取偶数的方式。四舍六入五取偶;五取偶 的规则:当小数部分恰为0.5时,若个位是奇数则入,若个位是偶数则舍,总之让个位变成偶数。
Math.round(-0.1) // -0 Math.floor(-0.1 + 0.5) // +0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Math 对象
new
调用Math 对象的值属性
Math.E
Math.LN10
Math.LN2
Math.LOG10E
Math.LOG2E
Math.PI
Math.SQRT1_2
Math.SQRT2
Math [ @@toStringTag ]
初始值为字符串 "Math"
属性描述符为
{ [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }
Math 对象的函数属性
Math.abs ( x )
NaN
那么还是返回NaN
Math.acos ( x )
Math.acosh ( x )
Math.asin ( x )
Math.asinh ( x )
Math.atan ( x )
Math.atanh ( x )
Math.atan2 ( y, x )
Math.cbrt ( x )
Math.ceil ( x )
-Math.floor(-x)
相同NaN
,返回NaN
+0
,返回+0
-0
,返回-0
+∞
,返回+∞
-∞
,返回-∞
-0
Math.clz32 ( x )
Math.cos ( x )
Math.cosh ( x )
Math.exp ( x )
Math.expm1 ( x )
Math.floor ( x )
-Math.ceil(-x)
相同Math.fround ( x )
Math.hypot ( value1, value2, ...values )
Math.imul ( x, y )
Math.log ( x )
Math.log1p ( x )
Math.log10 ( x )
Math.log2 ( x )
Math.max ( value1, value2, ...values )
Math.min ( value1, value2, ...values )
Math.pow ( base, exponent )
Math.random ( )
Math.round ( x )
Math.sign ( x )
Math.sin ( x )
Math.sinh ( x )
Math.sqrt ( x )
Math.tan ( x )
Math.tanh ( x )
Math.trunc ( x )
The text was updated successfully, but these errors were encountered: