| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Calculates the natural logarithm of a numeric value.
Log( <nNumber> ) --> nNaturalLog
The function returns the natural logarithm of <nNumber> as a numeric value.
The mathematical function Log() calculates the natural logarithm for a mumeric value. The natural logarithm is based on the Euler number 2.7183... which is usually abbreviated as "e".
The inverse function of Log() is Exp().
| See also: | Exp(), SET DECIMALS, SET FIXED |
| Category: | Mathematical functions , Numeric functions |
| Source: | rtl\math.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example shows results of function Log()
PROCEDURE Main
SET DECIMALS TO 5
? Log(10) // result: 2.30259
? Log(100) // result: 4.60517
? Log(1) // result: 0.00000
? Exp(Log(1)) // result: 1.00000
RETURN
http://www.xHarbour.com