| dec | bin | ||
| hex | oct |
| Expression | Translation | Description |
|---|---|---|
| x**y | Math.pow(x,y) | x to the power of y |
| sqrt(x) | Math.sqrt(x) | square root of x |
| exp(x) | Math.exp(x) | e to the power of x |
| log(x) | Math.log(x) | natural logarithm of x |
| round(x) | Math.round(x) | rounds to the nearest integer |
| floor(x) | Math.floor(x) | rounds x downwards |
| ceil(x) | Math.ceil(x) | rounds x upwards |
| abs(x) | Math.abs(x) | absolute value of x |
| cos(x) | Math.cos(x) | cosine of x |
| sin(x) | Math.sin(x) | sine of x |
| tan(x) | Math.tan(x) | tangent of x |
| acos(x) | Math.acos(x) | arccosine of x |
| asin(x) | Math.asin(x) | arcsine of x |
| atan(x) | Math.atan(x) | arctangent of x |
| rand | Math.random() | random number between 0 and 1 |
| Constant | Translation | Description |
|---|---|---|
| e | Math.E | Euler's constant (approx. 2.718) |
| pi | Math.PI | PI (approx. 3.14159) |
| ln2 | Math.LN2 | natural logarithm of 2 (approx. 0.693) |
| ln10 | Math.LN10 | natural logarithm of 10 (approx. 2.302) |
| log2e | Math.LOG2E | base-2 logarithm of E (approx. 1.442) |
| log10e | Math.LOG10E | base-10 logarithm of E (approx. 0.434) |
| sqrt1_2 | Math.SQRT1_2 | square root of 1/2 (approx. 0.707) |
| sqrt2 | Math.SQRT2 | square root of 2 (approx. 1.414) |