Siebel eScript Language Reference > Methods Reference > Mathematical Methods >

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 Table 106.

Format

Math.log(number)

Using the Get Logarithm Method and Raise Power Method with Large Numbers

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.");
    }

Siebel eScript Language Reference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.