xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Log()

Calculates the natural logarithm of a numeric value.

Syntax

Log( <nNumber> ) --> nNaturalLog

Arguments

<nNumber>
A numeric value greater than zero.

Return

The function returns the natural logarithm of <nNumber> as a numeric value.

Description

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().

Info

See also:Exp(), SET DECIMALS, SET FIXED
Category: Mathematical functions , Numeric functions
Source:rtl\math.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe