Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
Log Function
This standard VB function returns the natural logarithm of a number.
Syntax
Log(number)
Returns
The natural logarithm of number.
Usage
The return value is single-precision for an integer, currency, or single-precision numeric expression; double precision for a long, variant, or double-precision numeric expression.
Example
This example uses the Log function to determine which number is larger: 999^1000 (999 to the 1000th power) or 1000^999 (1000 to the 999th power). Note that you cannot use the exponent (^) operator for numbers this large.
Sub Button_Click
Dim x
Dim y
x = 999
y = 1000
a = y * (Log(x))
b = x * (Log(y))
If a>b then
"999^1000 is greater than 1000^999"
Else
"1000^999 is greater than 999^1000"
End If
End SubSee Also
Exp Function
Fix Function
Int Function
Rnd Function
Sgn Function
Sqr Function
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |