Math.PI (3.14159...) Math.E (2.718...) Math.LN2 (0.693...) Math.LN10() (2.302...) Math.LOG10E() (0.434...) Math.SQRT1_2() (0.707...) Math.SQRT2 (1.414...)
The methods available via the Math object provide a lot of the normal mathematical functions that you would expect (assuming that you can remember the mathematics that you studied in high school) as well as a number of functions for comparing and manipulating numbers.
arc cosine (in radians)
arc sine (in radians)
arc tangent (in radians)
smallest integer greater than or equal to the number
largest integer less than or equal to the number
e to the power of number
natural log of number
base to exponent power
greater of the two (or more) numbers
smaller of the two (or more) numbers
rounds the number to the nearest integer
finds the square root of the number
The Math methods that you will probably use most frequently are Math.floor, Math.round and Math.ceil all of which have the effect of converting the number passed to it into an integer. The only difference between the three is the rule that is followed in working out which way to round the number. Of the three discarding the fraction by using Math.floor will probably be the most useful.
This article written by Stephen Chapman, Felgall Pty Ltd.