IMLN
Returns the natural logarithm of a complex number.
Produces the principal complex logarithm as text.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=IMLN(inumber)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
inumber | any | Required | — |
Return type
Can return text.
How it works
The principal logarithm of z is ln(|z|) + i arg(z). Zero has no logarithm, and the principal value uses a branch cut on the negative real axis.
Differences from Excel
The raw Formualizer text can contain more significant digits than Excel’s complex-number text. The examples round each coefficient to 15 significant digits for display.
Remarks
- Input is coerced to complex-number text before parsing.
Error cases
- Returns
#NUM!for zero input becauseln(0)is undefined. - Invalid complex text returns
#NUM!.
Examples
For 3 + 4i, combine the natural logarithm of its magnitude five with its angle.
Formula =IMLN("3+4i")
Expected result 1.6094379124341+0.927295218001612i
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A negative angle changes the imaginary term of the principal logarithm.
Formula =IMLN("3-4j")
Expected result 1.6094379124341-0.927295218001612j
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The natural logarithm of a positive real unit is zero.
Formula =IMLN("1")
Expected result 0
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The text “invalid” has no complex value from which to take the natural logarithm.
Formula =IMLN("invalid")
Expected result #NUM!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Natural log on imaginary axis
Formula =IMLN("i")
Expected result 1.5707963267949i
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
Why does IMLN(0) return #NUM!?
The complex logarithm at zero is undefined, so this implementation returns #NUM!.