> For the complete documentation index, see [llms.txt](https://docs.settlers-united.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.settlers-united.com/s4-lua-api-de/su-library-functions/su.math/su.math.log.md).

# SU.Math.log

## SU.Math.log(value, base)

Gibt den natürlichen Logarithmus (Basis e) oder den Logarithmus zu einer optionalen Basis zurück.

#### Parameter

* `value`: `number` – Positive reelle Zahl (größer als 0)
* `base`: `number` *(optional)* – Basis des Logarithmus (Standard: e)

#### Rückgabewert

* `number` – Der Logarithmus von `value`
* `-inf` ([SU.Math.isInf](/s4-lua-api-de/su-library-functions/su.math/su.math.isinf.md)): Bei Eingabe von 0
* `nan` (not a number, [SU.Math.isNan](/s4-lua-api-de/su-library-functions/su.math/su.math.isnan.md)): Bei negativen Eingaben

#### Beispiel

```lua
local naturalLog = SU.Math.log(2.71828)    -- liefert ca. 1.0
local customLog  = SU.Math.log(8, 2)        -- liefert ca. 3.0
```
