Get Logarithm Method
The Get Logarithm method returns an approximate natural logarithm of the value that the number argument contains.
This method uses the same argument as the Get Absolute Value method. For more information, see Get Absolute Value Method.
Format
Math.log(number)
For a large number, you must use the Get Logarithm method. The number 999^1000 (999 to the 1000th power) is an example of a large number. If you use the Raise Power method instead of the Get Logarithm method with a large number, then the Raise Power method returns the following value:
Infinity
Example
This example uses the Get Logarithm method to determine which of the following numbers is larger:
999^1000 (999 to the 1000th power)
1000^999 (1000 to the 999th power):
function Test_Click ()
{
var x = 999;
var y = 1000;
var a = y*(Math.log(x));
var b = x*(Math.log(y))
if ( a > b )
TheApplication().
RaiseErrorText("999^1000 is greater than 1000^999.");
else
TheApplication().
RaiseErrorText("999^1000 is not greater than 1000^999.");
}