You can use Math object to do mathematical calculation.
Property | Description |
Math E Property | The E property returns the Euler's number and the base of natural logarithms, approximately 2.718.
|
Math LN10 Property | The LN10 property returns the natural logarithm of 10, approximately 2.302.
|
Math LN2 Property | The LN2 property returns the natural logarithm of 2, approximately 0.693.
|
Math LOG10E Property | The LOG10E property returns the base-10 logarithm of E, approximately 0.434.
|
Math LOG2E Property | The LOG2E property returns the base-2 logarithm of E, approximately 1.442.
|
Math PI Property | The PI property returns the ratio of a circle's area to the square of its radius, approximately 3.141592
|
Math SQRT1_2 Property | The SQRT1_2 property returns the square root of 1/2, approximately 0.707.
|
Math SQRT2 Property | The SQRT2 property returns the square root of 2, approximately 1.414.
|
Method | Description |
Math abs() Method | The abs() method returns the absolute value of a number.
|
Math acos() Method | The acos() method returns the arccosine of a number as a value value between 0 and PI radians.
|
Math acosh() Method | The acosh() method returns the hyperbolic arccosine of a number.
|
Math asin() Method | The asin() method returns the arcsine of a number as a value between -PI/2 and PI/2 radians.
|
Math asinh() Method | The asinh() method returns the hyperbolic arcsine of a number.
|
Math atan() Method | The atan() method returns the arctangent of a number as a value between -PI/2 and PI/2 radians.
|
Math atan2() Method | The atan2() method returns the arctangent of the quotient of its arguments, between PI and -PI radians.
|
Math atanh() Method | The atanh() method returns the hyperbolic arctangent of a number.
|
Math cbrt() Method | The cbrt() method returns the cubic root of a number.
|
Math ceil() Method | The ceil() method rounds a number UPWARDS to the nearest integer, and returns the result.
|
Math cos() Method | The cos() method returns the cosine of a number.
|
Math cosh() Method | The cosh() method returns the hyperbolic cosine of a number.
|
Math exp() Method | The exp(x) method returns the value of E^x, where E is Euler's number (approximately 2.7183).
|
Math floor() Method | The floor() method rounds a number downwards to the nearest integer, and returns the result.
|
Math log() Method | The log() method returns the natural logarithm (base E) of a number.
|
Math max() Method | The max() method returns the number with the highest value.
|
Math min() Method | The max() method returns the number with the highest value.
|
Math pow() Method | The pow() method returns the value of x to the power of y (x^y).
|
Math random() Method | The random() method returns a random number from 0 (inclusive) up to but not including 1 (exclusive).
|
Math round() Method | The round() method rounds a number to the nearest integer.
|
Math sin() Method | The sin() method returns the sine of a number.
|
Math sinh() Method | The sinh() method returns the hyperbolic sine of a number.
|
Math sqrt() Method | The sqrt() method returns the square root of a number.
|
Math tan() Method | The tan() method returns a number that represents the tangent of an angle.
|
Math tanh() Method | The tanh() method returns a number that represents the hyperbolic tangent of a number.
|
Math trunc() Method | The trunc() method returns the integer part of a number.
|