EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - LOG10 E (Math.log10 E Property); LOG2 E (Math.log2 E Property)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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

Table of Contents

Related product manuals