Function reference · Math
log
Computes the natural logarithm or a logarithm with an explicit base.
With one argument, log uses base e. An optional second argument selects a base. Exact integer-base powers and common symbolic forms are simplified when safe.
Complex inputs use the principal logarithm, and real-domain logarithm rewrites are only applied when their sign requirements are established.
Examples
These examples use Nerdamer Notation.
Evaluate the natural logarithm of e.
log(e) // → 1
Evaluate an exact logarithm with base 2.
log(8,2) // → 3
Keep a symbolic logarithm.
log(x)Interfaces
The same operation is available through the interfaces below.
Nerdamer Notation
Use this form inside input passed to nerdamer(...).
log(arg1, [arg2])
nerdamer.log
Call the operation through the default nerdamer import.
nerdamer.log(x: ExpressionInput, base?: ExpressionInput, expandPrimes: boolean): Expression
Parameters
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | The expression to take the logarithm of. |
base | ExpressionInput | Optional logarithm base. Defaults to `e` (natural log). |
expandPrimes | boolean | When `true`, decomposes integer arguments into prime factors (e.g. `log(8)` becomes `3·log(2)`). Defaults to `false`. |
Returns
Expression — The logarithm of `x`.
