Log

From NSB App Studio
Revision as of 17:40, 8 July 2012 by Brendon (talk | contribs) (Created page with "LOG(''number'') '''Description''' LOG returns a double-precision value equal to the natural logarithm of a number. The required parameter, ''number'', is any numeric express...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

LOG(number)

Description

LOG returns a double-precision value equal to the natural logarithm of a number. The required parameter, number, is any numeric expression. The natural logarithm is the base e logarithm; e is approximately equal to 2.718282.

Calculating base-n logarithm of x is achieved by dividing the natural logarithm of x by the natural logarithm of n.

Example

REM LOG Example
'LOG calculates natural logarithms
DIM e
e = 2.718282
PRINT "LOG(1) = " & LOG(1)
PRINT "LOG(e) = " & LOG(e)
PRINT "LOG10(2) = " & LogN(10, 2)
FUNCTION LogN(Base, Number)
  LogN = LOG(Number) / LOG(Base)
END FUNCTION

Output

LOG(1) = 0
LOG(e) = 1
LOG10(2) = 0.30103

Related Items

EXP