IMSQRT Function (Gnumeric)
Learn the IMSQRT function in Gnumeric: Returns the square root of a complex number.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Gnumeric. How formula examples are checked
Purpose: a root when the input may be negative or complex
IMSQRT calculates a complex square root: a number w such that w × w = z. It supports complex input where an ordinary real-number square root cannot represent the result. For instance, (2+i)² = 3+4i, so the principal square root of 3+4i is 2+i. The official Gnumeric Complex manual documents IMSQRT(z) as the square-root function and identifies invalid complex input as an error [1, IMSQRT]. The principal-root convention in the worked examples is independently calculated mathematical context, not a claim that all exact string layouts were observed in Gnumeric.
Version-specific error distinction: The online 1.12 manual describes malformed complex inputs as
#VALUE!. The official 1.12.62 source instead returns#NUM!when parsing a malformed complex string; other unsupported value types can still return#VALUE!. Any#VALUE!expectations below are the manual’s older documented rule, not verified 1.12.62 output. No native error test was performed.
Exact Gnumeric syntax
=IMSQRT(z)
| Position | Argument | Required | Input type and meaning | Default |
|---|---|---|---|---|
| 1 | z |
Yes | The complex number whose square root is needed, e.g. "3+4i" or COMPLEX(real,imaginary). |
None; there are no optional arguments in the documented signature. |
Gnumeric’s manual documents #VALUE! for invalid complex values and calls IMSQRT Microsoft Excel compatible [1, IMSQRT]. It does not promise a particular number of displayed digits, coercion of all text types, or all possible exceptional numeric representations.
Reproduce a 3–4–5 complex-number example
| Cell | Enter | Meaning |
|---|---|---|
| A1 | Real part |
Heading |
| B1 | Imaginary part |
Heading |
| C1 | Complex number |
Heading |
| D1 | Square root |
Heading |
| E1 | Squared check |
Heading |
| A2 | 3 |
x component |
| B2 | 4 |
y component |
| C2 | =COMPLEX(A2,B2) |
Represents 3+4i [1, COMPLEX] |
| D2 | =IMSQRT(C2) |
Root [1, IMSQRT] |
| E2 | =IMPRODUCT(D2,D2) |
Multiply root by itself [1, IMPRODUCT] |
Independently expected results: D2 = 2+i, because (2+i)² = 4+4i+i² = 3+4i; E2 should return the original mathematical value 3+4i. This is a powerful audit: the core function and the distinct IMPRODUCT formula can be checked against each other without treating any spreadsheet’s string-display choices as established.
Other useful inputs and expected roots
| Formula | Independent principal-root expectation | Interpretation |
|---|---|---|
=IMSQRT(COMPLEX(3,4)) |
2+i |
First-quadrant complex root. |
=IMSQRT(COMPLEX(3,-4)) |
2-i |
Conjugated input, conjugated principal root. |
=IMSQRT(COMPLEX(-4,0)) |
2i |
Square root of negative real input within complex arithmetic. |
=IMSQRT(COMPLEX(0,0)) |
0 |
Zero root; precise formatted representation not asserted. |
=IMSQRT(COMPLEX(9,0)) |
3 |
Positive real axis. |
=IMSQRT("invalid") |
#VALUE! documented |
Invalid complex notation [1]. |
The choice COMPLEX(-4,0) is intentional: a bare negative real number passed through the conventional real SQRT can be invalid in real-only calculation, whereas IMSQRT is documented as operating on complex numbers [1]. Whether the specific display shows 2i, 0+2i, or similar text is subject to native verification.
A concrete application: roots of a complex quadratic
Suppose a complex-valued equation simplifies to w² = 3+4i. Enter =COMPLEX(3,4) in A2 and =IMSQRT(A2) in B2. Independently, the two algebraic solutions are 2+i and -2-i. IMSQRT chooses one conventional branch/root, not both solutions. To construct the other solution without relying on a separate negation function, enter =IMSUB(COMPLEX(0,0),B2) in C2. Both should square to A2 under IMPRODUCT(B2,B2) and IMPRODUCT(C2,C2) [1, IMSUB / IMPRODUCT].
This is an example of solving a mathematical relation, not an instruction to substitute the complex root into a real-only application without checking the model’s domain.
Advanced use: stable auditing and branch awareness
To compare the square-root result against the original input, use =IMABS(IMSUB(IMPRODUCT(B2,B2),A2)). For the exact textbook values above, the independent expected residual magnitude is 0. With non-integer coefficients, machine rounding can make a tiny nonzero residual: compare against a tolerance and document the input scale. IMABS, IMSUB, and IMPRODUCT are separate functions documented by Gnumeric [1].
Complex square roots have two solutions for every nonzero input; choosing the principal branch means the returned root may change discontinuously in its imaginary sign when input phase crosses a branch cut. For values near the negative real axis, check the actual input’s imaginary sign and avoid promising smooth movement of the root from one row to the next. The exact signed-zero and branch-edge formatting behavior requires native testing in the target release.
Errors and troubleshooting
| Symptom | What the Gnumeric evidence supports |
|---|---|
#VALUE! |
Invalid complex input is documented to trigger this error [1, IMSQRT]. |
Negative real input does not show #NUM! as expected from real SQRT |
You are using a complex-number function; the mathematical principal square root of -4 is 2i, not a real number. Verify the string-rendering in Gnumeric. |
| Want both roots but receive one | IMSQRT returns one branch value; the other is the negative of the first for nonzero input. |
| Squaring the output gives a tiny residual | Floating-point rounding. Compare residual magnitude to a documented tolerance. |
i and j suffixes, empty strings, or blank cells |
The manual does not provide a comprehensive coercion/format matrix; avoid asserting exact results without a Gnumeric run. |
| Formula rejected | Check the documented name, formula separators, valid source references and the actual application locale [5,6]. |
| Export/import changes displayed text | No XLSX/ODS round-trip was performed; do not treat catalogue status as format-interoperability certification. |
Version, software, locale and compatibility boundaries
This is a guide to Gnumeric, based on the Gnumeric 1.12 manual [1]. Gnumeric’s own function catalogue [2] lists IMSQRT as Complete / Exhaustive: the first term reports catalogue implementation classification; the second is the project’s test-suite category. Neither is a record of running the examples in this tutorial. The 1.12.62 release announcement [3] mentions improved compatibility for complex-number functions generally, but does not assert this tutorial’s examples were tested, nor identify every supported older release.
The official Gnumeric manual explicitly labels this function Microsoft Excel compatible [1, IMSQRT]. This means a function-level classification, not a promise of identical branch-edge formatting or errors in every imported workbook; it is not proof of byte-for-byte identical imports, worksheet display, coercion of blanks, text-number conversion, or localized formula entry in Microsoft Excel. Do not infer compatibility from another spreadsheet’s identically named function.
The formulas here use Gnumeric’s English-language function names, a period for the decimal separator, and commas between arguments. The Gnumeric 1.12 manual illustrates commas as function-argument separators [5]; its locale documentation explains that numeric conventions are influenced by system locale [6]. Confirm the actual installation’s formula editor and locale before pasting examples or changing separators. Gnumeric’s download guidance describes Linux/BSD distributor packages as the usual installation route and says the project does not currently distribute Windows binaries [4]. This does not prove a function works on every platform or build.
A complex number such as "3+4i" is passed as text notation to the complex-function family. A different unit suffix (i versus j), case, spaces, Unicode minus signs, explicit empty strings, missing cells, and errors are possible parsing or coercion edge cases; the official function reference is not a complete acceptance matrix. This page does not claim those cases were executed. Use COMPLEX(real,imaginary) to construct consistently formed values when possible [1, COMPLEX].
Related Gnumeric function guides
Official references and claim provenance — checked 2026-10-13
- Gnumeric 1.12: Complex-function reference — canonical signature, specific argument meanings and documented errors; function sections noted inline above.
- Gnumeric function catalogue — presence, implementation label and upstream test-suite classification; not independent execution of this guide.
- Gnumeric 1.12.62 release announcement — announced release context and general complex-number compatibility improvements.
- Gnumeric official download and platform guidance — distribution routes and lack of currently distributed Windows binaries.
- Gnumeric 1.12: types of cell elements / using functions — documented function-form and comma argument separator for the English examples.
- Gnumeric 1.12: languages and locales — locale behaviour and numeric formatting context.
Evidence boundary: The examples were independently calculated and checked against official documentation and the Gnumeric 1.12.62 source. Native execution, locale checks and file round-trips were not performed.