Math
753
Example
The following example displays the logarithm for three numerical values.
trace(Math.log(0)); // output: -Infinity
trace(Math.log(1)); // output: 0
trace(Math.log(2)); // output: 0.693147180559945
trace(Math.log(Math.E)); // output: 1
LOG10E (Math.LOG10E property)
public static LOG10E : Number
A mathematical constant for the base-10 logarithm of the constant e (
Math.E
), expressed as
log10e, with an approximate value of 0.4342944819032518.
The
Math.log()
method computes the natural logarithm of a number. Multiply the result of
Math.log()
by
Math.LOG10E
obtain the base-10 logarithm.
Availability:
ActionScript 1.0; Flash Player 5 - In Flash Player 4, the methods and properties
of the Math class are emulated using approximations and might not be as accurate as the non-
emulated math functions that Flash Player 5 supports.
Example
This example shows how to obtain the base-10 logarithm of a number:
trace(Math.log(1000) * Math.LOG10E);
// Output: 3
LOG2E (Math.LOG2E property)
public static LOG2E : Number
A mathematical constant for the base-2 logarithm of the constant e (
Math.E
), expressed as
log2e, with an approximate value of 1.442695040888963387.
The
Math.log
method computes the natural logarithm of a number. Multiply the result of
Math.log()
by
Math.LOG2E
obtain the base-2 logarithm.
Availability:
ActionScript 1.0; Flash Player 5 - In Flash Player 4, the methods and properties
of the Math class are emulated using approximations and might not be as accurate as the non-
emulated math functions that Flash Player 5 supports.
Example
This example shows how to obtain the base-2 logarithm of a number:
trace(Math.log(16) * Math.LOG2E);
// Output: 4
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...