Skip to content

Commit f472b70

Browse files
authored
Merge pull request #960 from boriel-basic/docs
doc: adds LN documentation
2 parents 989102d + e800ed7 commit f472b70

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

docs/ln.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# LN
2+
3+
## Syntax
4+
5+
```
6+
LN(numericExpression)
7+
```
8+
9+
10+
## Description
11+
12+
Returns the Natural Logarithm of the _numeric expression given_.
13+
A natural logarithm is a logarithm in base _e_ (_e_ value can be
14+
obtained with `EXP(1)`).
15+
16+
Both the argument and the result are of type `Float`.
17+
18+
## Examples
19+
20+
```basic
21+
PRINT "LN(10) is "; LN(10)
22+
```
23+
24+
You can compute the logarithm in any `base` dividing `LN(x)` by `LN(base)`:
25+
26+
```basic
27+
PRINT "LN2(8) is "; LN(8) / LN(2) : REM Base 2 Logarithm
28+
PRINT "LOG(100) is "; LN(100) / LN(10) : REM Base 10 Logarithm
29+
```
30+
31+
32+
## Remarks
33+
34+
* This function is 100% Sinclair BASIC Compatible
35+
* If the given argument type is not float, it will be [converted](cast.md) to float before operating with it.
36+
37+
## See also
38+
39+
* [EXP](exp.md)

0 commit comments

Comments
 (0)