| Math.log( ) Method | Flash 5; can be used when exporting Flash 4 movies |
| compute the natural logarithm of a number |
A positive integer.
The natural logarithm of x.
The log( ) method calculates the natural logarithm (i.e., the base-e logarithm) of a number. See the following Example to calculate the base-10 logarithm.
trace (Math.log(Math.E)); // Displays: 1
// Compute the base-10 logarithm of a number
function log10 (x) {
return (Math.log(x) / Math.log(10));
}