From e800ed78d05041583b0451e5bd335207b1077368 Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Sun, 23 Feb 2025 14:18:48 +0100 Subject: [PATCH] doc: adds LN documentation --- docs/ln.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 docs/ln.md diff --git a/docs/ln.md b/docs/ln.md new file mode 100644 index 000000000..85d93360e --- /dev/null +++ b/docs/ln.md @@ -0,0 +1,39 @@ +# LN + +## Syntax + +``` +LN(numericExpression) +``` + + +## Description + +Returns the Natural Logarithm of the _numeric expression given_. +A natural logarithm is a logarithm in base _e_ (_e_ value can be +obtained with `EXP(1)`). + +Both the argument and the result are of type `Float`. + +## Examples + +```basic +PRINT "LN(10) is "; LN(10) +``` + +You can compute the logarithm in any `base` dividing `LN(x)` by `LN(base)`: + +```basic +PRINT "LN2(8) is "; LN(8) / LN(2) : REM Base 2 Logarithm +PRINT "LOG(100) is "; LN(100) / LN(10) : REM Base 10 Logarithm +``` + + +## Remarks + +* This function is 100% Sinclair BASIC Compatible +* If the given argument type is not float, it will be [converted](cast.md) to float before operating with it. + +## See also + +* [EXP](exp.md) \ No newline at end of file