Math object has no constructor thus you cannot create instances of it. Consider Math as a namespace - collection of static methods and constants.
Properties (constants) | |
E | - float, e - Euler's constant, the base of natural logarithms. |
LN2 | - float, value of natural logarithm of 2. |
LN10 | - float, value of natural logarithm of 10. |
LOG2E | - float, value of base 2 logarithm of e constant. |
LOG10E | - float, value of base 10 logarithm of e constant. |
PI | - float, Pi constant - the ratio of the circumference of a circle to its diameter. |
SQRT1_2 | - float, value of square root of 0.5. |
SQRT2 | - float, value of square root of 2.0. |
Methods | |
abs |
( integer | float ) Returns abs (positive) value of integer or float argument. |
sin cos |
( integer | float ) returns: float Returns value of sine or cosine of its argument. |
tan atan |
( integer | float ) returns: float
Returns tangent or arctangent if its argument. |
asin acos |
( integer | float ) returns: float
Returns arcsine or arccosine if its argument. |
sqrt |
( integer | float ) returns: float Returns the square root of the argument. |
ceil |
( float ) returns: integer Returns the smallest integer greater than or equal to the argument. |
floor |
( float ) returns: integer Returns the largest integer that is less than or equal to the argument |
exp |
( integer | float ) returns: float Returns the exponential value of the argument, if successful. On overflow, the function returns INF (infinite) and on underflow, exp returns 0.0. To test number on infinity use Float.isFinite(value) method. |
log log2 log10 |
( integer | float ) returns: float
The log functions return logarithms of the argument if successful. If argument is negative, these functions return an indefinite (NaN). If argument is 0, they return INF (infinite). To test number on infinity use Float.isFinite(value) method. |
pow |
( number, exponent ) returns: float | integer Calculates number raised to the power of exponent: result = numberexponent |