Developer Documentation Library > UNICOM Intelligence Function Library > Mathematical functions > Log
 
Log
Returns the logarithm of a number.
Syntax
Log(<value> [, <base>])
Parameters
<value>
Type: Double
A numeric value.
<base>
Type: Double
(Optional.) The base for the logarithm. If omitted or <= 0.0, e is used.
(return)
Type: Double
Logarithm of <value>.
Notes
The logarithm is the power to which Base must be raised to get <value>. If Base is not specified, base e is used to return the natural logarithm of <value>. Base e is approximately 2.718282.
An error occurs if <value> is negative or if Base is 1.0 (as 1.0 raised to any power is always 1.0). If <value> is 0.0, the return value is 0.0. If the current data value is NULL, <value> is 0.0 and the return value is 0.0.
This function is similar to the Log function in VBScript.
Example
The following mrScriptBasic example uses the Log function to return the natural logarithm of 15, and the logarithm of 15 to the base of 10:
Dim MyNaturalLogarithm, MyLog10
MyNaturalLogarithm = Log(15) ' Returns 2.70805020110221
MyLog10 = Log(15, 10) ' Returns 1.17609125905568
See also
Exp
Mathematical functions