ln
Last updated
Last updated
will return the natural logarithm of x, given as the argument. The return_type specifies in which data type the result will be returned in, like shown in below example:
Natural logarithm f(x) = ln(x) isn't defined for non-positive numbers, so the compiler will throw an exception:
The function works so that it can also handle big integers/numbers aswell. How it works, as we first take the scientific notation of the number, calculate the value using the very fast converging expansion and then multiplying the value by n - 1 times of log10. You can find an in depth explanation of this approach here: .