Contact

IMSQRT Function (OpenOffice Calc)

Engineering Intermediate OpenOffice Calc

Find principal complex square roots in Apache OpenOffice, with quadrant examples, zero and negative-axis conventions.

Verification status: Eight reference formulas and 4 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: =IMSQRT("3+4i") returned 2+i 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 IMSQRT returns

IMSQRT returns the principal square root of a complex number as text. A nonzero complex value has two mathematical square roots; this function selects one branch rather than returning both. Zero is a valid input and has square root zero. Release entry.

Syntax and arguments

=IMSQRT(ComplexNumber)

Exactly one parsed complex argument is required. Pure real inputs and lowercase i/j complex forms are accepted by the parser. Invalid nonempty text and an empty string are rejected. The selected root has a nonnegative real component, with the imaginary sign chosen from the input branch convention.

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
=IMSQRT("3+4i") 2+i (2, 1)
=IMSQRT("3-4i") 2-i (2, -1)
=IMSQRT("-3+4i") 1+2i (1, 2)
=IMSQRT("-3-4i") 1-2i (1, -2)
=IMSQRT("1") 1 (1, 0)
=IMSQRT("i") 0.707106781186547+0.707106781186547i (0.707106781187, 0.707106781187)
=IMSQRT("-1") i (0, 1)
=IMSQRT("0.5+0.25i") 0.727673345112677+0.171780374861256i (0.727673345113, 0.171780374861)

Practical worksheet

=IMSQRT("3+4i") returns 2+i, because (2+i)²=3+4i. The other mathematical root, −2−i, is not a second result from this function. For 3−4i the selected root is 2−i.

If a complex value is stored in A2, =IMSQRT(A2) applies the same operation. Keep the original string and the root together when solving a quadratic or checking a model that may require both roots.

Advanced interpretation and checks

For z=a+bi with r=|z|, the helper computes the real magnitude √((r+a)/2) and imaginary magnitude √((r−a)/2). It makes the imaginary component negative only when b<0.

On the negative real axis, b=0 follows the nonnegative branch, so the principal square root of −1 is +i. The negative-zero-looking string -1-0i is included below to make the tested sign convention explicit. Zero itself returns zero.

Squaring the selected root recovers z mathematically, but the reverse identity √(z²)=z is not universal on a principal branch. For example, squaring −1 gives 1 and the principal square root of 1 is +1. Use this distinction when simplifying a nested expression.

Boundaries and troubleshooting

Branch selection is part of the answer. Crossing the negative real axis can change the sign of the imaginary root abruptly even though nearby inputs differ only slightly. A different signed-zero or branch convention can produce another valid root.

The implementation uses finite-precision magnitude and square-root operations. Near cancellation in r−a or r+a, a very small component can lose relative precision. The native strings below retain their actual formatting rather than claiming exact arithmetic for every digit.

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
=IMSQRT("0") 0
=IMSQRT("abc") Err:502
=IMSQRT("") Err:502
=IMSQRT("-1-0i") i

Other spreadsheet implementations

The IMSQRT 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

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.