| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math | [Back] [Original] |
Get to know MDN better
Math new Math Math
Math
JavaScript
Math.E 2.718
Math.LN1010 2.303
Math.LN22 0.693
Math.LOG10E 10 E 0.434
Math.LOG2E 2 E 1.443
Math.PI 3.14159
Math.SQRT1_2 0.707
Math.SQRT22 1.414
Math[Symbol.toStringTag]Math.abs()Math.acos()Math.acosh()Math.asin()Math.asinh()Math.atan()Math.atan2()Math.atanh()Math.cbrt()Math.ceil()Math.clz32()32
Math.cos()Math.cosh()Math.exp() ex x e 2.718...
Math.expm1() exp(x) - 1
Math.floor()Math.f16round()Math.fround()Math.hypot()Math.imul()32
Math.log()e
Math.log10()10
Math.log1p() 1 + x x e
Math.log2()}2
Math.max()Math.min()Math.pow() x y xy
Math.random() 0 1
Math.round()Math.sign()0
Math.sin()Math.sinh()Math.sqrt()Math.sumPrecise()Math.tan()Math.tanh()Math.trunc() sin()cos()tan()asin()acos()atan() atan2()
CSS
function degToRad(degrees) {
return degrees * (Math.PI / 180);
}
function radToDeg(rad) {
return rad / (Math.PI / 180);
}
100
JavaScript
50 * Math.tan(degToRad(60));
degToRad() 60 Math.tan()
function random(min, max) {
const num = Math.floor(Math.random() * (max - min + 1)) + min;
return num;
}
random(1, 10);
| ECMAScript 2027 LanguageSpecification # sec-math-object |
MathMath.abs()Math.acos()Math.acosh()Math.asin()Math.asinh()Math.atan()Math.atan2()Math.atanh()Math.cbrt()Math.ceil()Math.clz32()Math.cos()Math.cosh()Math.exp()Math.expm1()f16round()Math.floor()Math.fround()Math.hypot()Math.imul()Math.log()Math.log1p()Math.log2()Math.log10()Math.max()Math.min()Math.pow()Math.random()Math.round()Math.sign()Math.sin()Math.sinh()Math.sqrt()sumPrecise()Math.tan()Math.tanh()Math.trunc()| Web Proxy Viewer | New URL | Original Page |