Make the function signature less prominent, add an early example to docs

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-06-19 17:08:46 +12:00
parent 6358eed7e4
commit ff1be99351
99 changed files with 2137 additions and 686 deletions

View File

@ -8,15 +8,16 @@ layout: manual
Compute the logarithm of the number with respect to an arbitrary base.
```kcl
log(
@input: number,
base: number(_),
): number
```
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [log(100, base = 5), 0])
|> line(end = [5, 8])
|> line(end = [-10, 0])
|> close()
The result might not be correctly rounded owing to implementation
details; `log2` can produce more accurate results for base 2,
and `log10` can produce more accurate results for base 10.
example = extrude(exampleSketch, length = 5)
```
### Arguments
@ -29,6 +30,20 @@ and `log10` can produce more accurate results for base 10.
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Description
The result might not be correctly rounded owing to implementation
details; `log2` can produce more accurate results for base 2,
and `log10` can produce more accurate results for base 10.
### Function signature
```kcl
log(
@input: number,
base: number(_),
): number
```
### Examples