IMLOG2 Function (OpenOffice Calc)
Evaluate base-2 complex logarithms in Apache OpenOffice, with scaled principal phase, reference components and strict nonzero input rules.
Verification status: Eight reference formulas and 3 diagnostic cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using XLSX import and GUI hard recalculation. Saved formula identities and typed results were checked. How formula examples are checked
Quick answer: =IMLOG2("3+4i") returned 2.32192809488736+1.33780421245098i in the tested Apache OpenOffice 4.1.16 build.
Availability and version history
- Introduced: First release not established; documented by OpenOffice.org 3.3.
- Supported in: Apache OpenOffice 4.1.16; this identifies a verified release, not a final supported version.
- Scope: Desktop Calc with its Analysis add-in, English function names and semicolon-separated formulas.
- Checked: October 14, 2026. Eight reference formulas and the listed diagnostics were recalculated after XLSX import in 4.1.16 on Linux x86-64, Build 9816. Source and independent reference calculations were also checked.
What IMLOG2 returns
IMLOG2 returns the principal complex logarithm divided by ln(2). Both components of the natural logarithm are scaled. For a positive real power of 2, it yields the corresponding real exponent as a complex-number string. Release entry.
Syntax and arguments
=IMLOG2(ComplexNumber)
Supply exactly one nonzero complex argument. Lowercase i or j suffixes are recognized, and pure real forms are valid. The natural-log helper rejects zero before scaling. Nonempty invalid text is rejected rather than treated as a numeric zero.
Reproducible examples
The native column records the saved 4.1.16 results. The native strings are retained exactly. Independent component references are rounded to twelve decimal places, with rounded negative zero shown as zero. A tiny stored residual can therefore appear in the native string beside a reference component rounded to zero. Every successful result below is string-typed, including pure real-looking outputs.
| Formula | Native 4.1.16 string | Independent (real, imaginary) reference |
|---|---|---|
=IMLOG2("3+4i") |
2.32192809488736+1.33780421245098i |
(2.321928094887, 1.337804212451) |
=IMLOG2("3-4i") |
2.32192809488736-1.33780421245098i |
(2.321928094887, -1.337804212451) |
=IMLOG2("-3+4i") |
2.32192809488736+3.19455592937622i |
(2.321928094887, 3.194555929376) |
=IMLOG2("-3-4i") |
2.32192809488736-3.19455592937622i |
(2.321928094887, -3.194555929376) |
=IMLOG2("1") |
0 |
(0, 0) |
=IMLOG2("i") |
2.2661800709136i |
(0, 2.266180070914) |
=IMLOG2("-1") |
4.53236014182719i |
(0, 4.532360141827) |
=IMLOG2("0.5+0.25i") |
-0.839035952556319+0.668902106225488i |
(-0.839035952556, 0.668902106225) |
Practical worksheet
For 3+4i, the real component is log2(5)≈2.321928094887 and the imaginary component is arg(3+4i)/ln(2)≈1.337804212451. =IMLOG2("3+4i") therefore retains direction information that an ordinary logarithm of the magnitude would discard.
A worksheet may place the validated complex value in A2 and use =IMLOG2(A2). Keep the base in the output label. A base-2 result cannot be substituted unchanged for a base-10 or natural logarithm in a later expression.
Advanced interpretation and checks
The source computes the principal natural logarithm and multiplies it by a stored approximation to 1/ln(2). For a positive real x, the imaginary component is zero and the real component agrees mathematically with log2(x).
For −1, the selected value is iπ/ln(2), approximately 4.532360141827i. For i, it is half that imaginary value. Unit-magnitude inputs have a zero real logarithmic magnitude, even though their complex logarithms need not be zero.
The mathematical inverse can be written exp(ln(2)×log2(z))=z for nonzero z on the selected representation. Principal-log algebra still has branch adjustments: a product identity can differ by a multiple of 2πi/ln(2).
Boundaries and troubleshooting
Zero does not produce a finite base-2 complex logarithm and is rejected. A negative real input is valid because this is a complex operation; its imaginary component records the branch.
The phase sign on the negative real axis follows the inherited strict imaginary<0 comparison. Tiny perturbations across that axis can produce a large change in the reported principal phase. Extremely large or small magnitudes and near-zero components need separate precision assessment.
These additional formulas were recalculated through the same import path. Error displays are retained as errors, even when an ODS numeric attribute stores zero.
| Formula | Observed result or error |
|---|---|
=IMLOG2("0") |
Err:502 |
=IMLOG2("abc") |
Err:502 |
=IMLOG2("-1-0i") |
4.53236014182719i |
Other spreadsheet implementations
The IMLOG2 guide for Calligra Sheets documents that product’s own syntax and tested behavior. A shared function name does not guarantee the same argument conversion, text parsing, branch or precision rules.
Official evidence and checking scope
- Function-specific release entry
- Complex algorithm or collection helper
- Strict complex-string parser
- Finite-output string formatter
- Inherited principal natural-log operation
The saved ODS retained every tested formula identity. A deliberately stale SUM cache changed from 999999 to 3, and an uncached SUM returned 7 after hard recalculation. Native evidence covers the eight reference formulas and listed diagnostics only. Other explanatory compositions are independent mathematical checks; other releases, locales and extreme-value behavior were not established by this run.