You can use the \(\text{ln}\) function to calculate the natural logarithm of a value.

You can use the \ln backslash command to insert this function.

The following variants of this function are available:

  • \(\text{complex } \text{ln} \left ( \text{<value>} \right )\)

Where <value> can be any basic type.

Note that run-time type conversion allows the result of this function to be assigned to any basic type provided the returned value is compatible with that type.

There are, in theory, an infinite number of possible results for the \(\text{ln}\) function on the complex plane, noting that:

\[e ^ { a + \theta i } = e ^ { a + \left ( \theta + 2 \pi k \right ) i }\]

Where \(k \in \mathbb{Z}\). The value \(k\) is referred to as the branch of the \(\text{ln}\) function. The \(\text{ln}\) function calculates the result for branch 0 only. To calculate the result for branch \(k\), use the expression \(\text{ln} \left ( x \right ) + 2i \pi k\).

The example below demonstrates how you can use the \(\text{ln}\) function:

\[a = \text{ln } 1\]
\[\text{a = 0}\]
\[b = \frac{\text{ln } -1}{\pi}\]
\[\text{b = 1i}\]