IMSQRT
Quirk foundCategory: Engineering · Last tested 2026-09-01
Real compatibility results for the IMSQRT function: executed in Excel for the web, Google Sheets and LibreOffice Calc, with desktop Excel behavior from Microsoft’s official documentation (we do not run desktop Excel — Excel for the web is a different application and is executed separately). Syntax and links to that documentation are below.
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel (desktop) | Yes | No — documented only | n/a |
| Excel for the web | — | Yes (recalc, 2026-09-01) | Quirk found |
| Google Sheets | Yes | Yes (Drive import, 2026-08-31) | Quirk found |
| LibreOffice Calc | Yes | Yes (25.8.7.3, 2026-08-31) | Supported, behaves as documented |
LibreOffice version history
We executed the same test cases under each LibreOffice release to show exactly when IMSQRT’s support changed — not documentation claims, real results.
| LibreOffice version | Verdict | Tested |
|---|---|---|
| 24.2.0.3 | Quirk found | 2026-08-31 |
| 24.8.7.2 | Quirk found | 2026-08-31 |
| 25.2.0.3 | Supported, behaves as documented | 2026-08-31 |
| 25.8.7.3 | Supported, behaves as documented | 2026-08-31 |
Why isn’t IMSQRT working in Google Sheets?
IMSQRT runs in Google Sheets, but our executed cases show it does not match
Excel’s documented behavior on every input (the failing cases are listed on this page). If a
formula that behaves one way in Excel gives you a different answer in Sheets, compare your usage
against those cases before assuming your data is wrong.
Discovered quirks
-
=IMSQRT("-1") on
Excel for the web returned
6.1257422745431E-17+i, but the documented/expected
result is i.
Provenance
Exact and definitional: the principal square root of -1 is i. In the documented polar form r = 1 and theta = pi, so the answer is cos(pi/2) + i*sin(pi/2) = 0 + 1i, with a real part of exactly zero and an imaginary coefficient of exactly 1. Excel's format therefore drops the real term entirely AND drops the digit 1, printing "i". EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. CROSS-VERSION DRIFT: THIS IS THE CASE THAT MOVES. The four pinned builds do not agree on this formula. 24.2.0.3 and 24.8.7.2 return "1i"; 25.2.0.3 and 25.8.7.3 return "i". Excel's documented format prints a coefficient of exactly 1 as "i" with no digit -- the rule this corpus validated against twenty published Microsoft strings, among them IMSUB("13+4i","5+3i") = "8+i" on Microsoft's own IMSUB page, where the imaginary coefficient is likewise exactly 1 and is likewise printed with no digit. So the newer builds are right and the older ones are wrong, and the change landed somewhere between 24.8.7.2 and 25.2.0.3. The NUMBER is identical on all four builds; only its rendering changed, so this is recorded as a formatting-only difference and not as a value error. It matters anyway: IM* functions return TEXT, so =IMSQRT("-1")="i" is FALSE on 24.2/24.8 and TRUE on 25.2/25.8, and any formula that compares, matches or joins these strings changes its answer when the workbook moves between releases.; MISMATCH vs expected: expected 'i', got '6.1257422745431E-17+i'
-
=IMSQRT("-4") on
Excel for the web returned
1.22514845490862E-16+2i, but the documented/expected
result is 2i.
Provenance
Exact: r = 4, theta = pi, so the answer is 2(cos(pi/2) + i*sin(pi/2)) = 0 + 2i. The real part is exactly zero and is dropped, but the coefficient is 2, so it IS printed. This case is the control for the IMSQRT("-1") case above: it exercises the same "omit the zero real part" rule on the same axis, and all four LibreOffice builds agree on it -- which is what isolates the 24.8-to-25.2 change to the coefficient-of-one rule specifically, rather than to the handling of negative reals in general. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value.; MISMATCH vs expected: expected '2i', got '1.22514845490862E-16+2i'
-
=IMSQRT("i") on
Excel for the web returned
0.707106781186548+0.707106781186547i, but the documented/expected
result is 0.707106781186548+0.707106781186548i.
Provenance
Exact: r = 1 and theta = pi/2, so the answer is cos(pi/4) + i*sin(pi/4), and cos(pi/4) = sin(pi/4) = sqrt(2)/2 = 0.707106781186547524401 EXACTLY -- the two parts are the same number. That is why this case is worth asserting: the two coefficients must be printed identically, and any engine whose polar route computes them along different paths will show it here in the last digit. (Python's own cmath.sqrt does exactly that, returning 0.7071067811865476 for the real part and 0.7071067811865475 for the imaginary one; all four LibreOffice builds print both as 0.707106781186548, which is the correctly-rounded value.) EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value.; MISMATCH vs expected: expected '0.707106781186548+0.707106781186548i', got '0.707106781186548+0.707106781186547i'
-
=IMSQRT("-1") on
Google Sheets returned
6.12323399573677E-17+i, but the documented/expected
result is i.
Provenance
Exact and definitional: the principal square root of -1 is i. In the documented polar form r = 1 and theta = pi, so the answer is cos(pi/2) + i*sin(pi/2) = 0 + 1i, with a real part of exactly zero and an imaginary coefficient of exactly 1. Excel's format therefore drops the real term entirely AND drops the digit 1, printing "i". EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. CROSS-VERSION DRIFT: THIS IS THE CASE THAT MOVES. The four pinned builds do not agree on this formula. 24.2.0.3 and 24.8.7.2 return "1i"; 25.2.0.3 and 25.8.7.3 return "i". Excel's documented format prints a coefficient of exactly 1 as "i" with no digit -- the rule this corpus validated against twenty published Microsoft strings, among them IMSUB("13+4i","5+3i") = "8+i" on Microsoft's own IMSUB page, where the imaginary coefficient is likewise exactly 1 and is likewise printed with no digit. So the newer builds are right and the older ones are wrong, and the change landed somewhere between 24.8.7.2 and 25.2.0.3. The NUMBER is identical on all four builds; only its rendering changed, so this is recorded as a formatting-only difference and not as a value error. It matters anyway: IM* functions return TEXT, so =IMSQRT("-1")="i" is FALSE on 24.2/24.8 and TRUE on 25.2/25.8, and any formula that compares, matches or joins these strings changes its answer when the workbook moves between releases.; MISMATCH vs expected: expected 'i', got '6.12323399573677E-17+i'
-
=IMSQRT("-4") on
Google Sheets returned
1.22464679914735E-16+2i, but the documented/expected
result is 2i.
Provenance
Exact: r = 4, theta = pi, so the answer is 2(cos(pi/2) + i*sin(pi/2)) = 0 + 2i. The real part is exactly zero and is dropped, but the coefficient is 2, so it IS printed. This case is the control for the IMSQRT("-1") case above: it exercises the same "omit the zero real part" rule on the same axis, and all four LibreOffice builds agree on it -- which is what isolates the 24.8-to-25.2 change to the coefficient-of-one rule specifically, rather than to the handling of negative reals in general. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value.; MISMATCH vs expected: expected '2i', got '1.22464679914735E-16+2i'
Executed test cases
Excel for the web (executed 2026-09-01 via OneDrive recalculation)
These values come from Excel for the web, not from desktop Excel. They are two different implementations of the calculation engine, and this run measured only the web one: the corpus was uploaded to OneDrive as .xlsx, recalculated by Excel for the web on open, and downloaded again for readback. Excel for the web is a rolling service with no pinnable version, so the run is identified by its date. Where a value here disagrees with the Expected column — which is Microsoft’s documentation of the desktop product — we cannot tell you whether the web engine diverges from the desktop one or the documentation is wrong about both, because we do not run desktop Excel.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =IMSQRT("1+i") | Microsoft's documented worked example: the square root of 1+i | 1.09868411346781+0.455089860562227i | 1.09868411346781+0.455089860562227iProvenanceMicrosoft publishes '=IMSQRT("1+i")' with the result 1.09868411346781+0.455089860562227i. Derived independently with mpmath at 40 digits from the polar identity the page renders as images -- sqrt(z) = sqrt(r)(cos(theta/2) + i*sin(theta/2)) with r = |z| and theta = arg(z): r = sqrt(2), theta = pi/4, so the answer is 2^(1/4)cos(pi/8) + i*2^(1/4)sin(pi/8) = 1.09868411346780996604 + 0.455089860562227341304i. Cross-check without any trigonometry: squaring the asserted pair reproduces the argument -- 1.09868411346781^2 - 0.455089860562227^2 = 1.0000000000000004 and 2 x 1.09868411346781 x 0.455089860562227 = 0.9999999999999993, i.e. 1+i back to fifteen digits. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Matched |
| =IMSQRT("-1") | sqrt(-1) = i, the one result whose printed form is a bare imaginary unit | 6.1257422745431E-17+i | iProvenanceExact and definitional: the principal square root of -1 is i. In the documented polar form r = 1 and theta = pi, so the answer is cos(pi/2) + i*sin(pi/2) = 0 + 1i, with a real part of exactly zero and an imaginary coefficient of exactly 1. Excel's format therefore drops the real term entirely AND drops the digit 1, printing "i". EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. CROSS-VERSION DRIFT: THIS IS THE CASE THAT MOVES. The four pinned builds do not agree on this formula. 24.2.0.3 and 24.8.7.2 return "1i"; 25.2.0.3 and 25.8.7.3 return "i". Excel's documented format prints a coefficient of exactly 1 as "i" with no digit -- the rule this corpus validated against twenty published Microsoft strings, among them IMSUB("13+4i","5+3i") = "8+i" on Microsoft's own IMSUB page, where the imaginary coefficient is likewise exactly 1 and is likewise printed with no digit. So the newer builds are right and the older ones are wrong, and the change landed somewhere between 24.8.7.2 and 25.2.0.3. The NUMBER is identical on all four builds; only its rendering changed, so this is recorded as a formatting-only difference and not as a value error. It matters anyway: IM* functions return TEXT, so =IMSQRT("-1")="i" is FALSE on 24.2/24.8 and TRUE on 25.2/25.8, and any formula that compares, matches or joins these strings changes its answer when the workbook moves between releases. |
Mismatch |
| =IMSQRT("-4") | sqrt(-4) = 2i, the same branch of the format rule but with a coefficient that is not 1 | 1.22514845490862E-16+2i | 2iProvenanceExact: r = 4, theta = pi, so the answer is 2(cos(pi/2) + i*sin(pi/2)) = 0 + 2i. The real part is exactly zero and is dropped, but the coefficient is 2, so it IS printed. This case is the control for the IMSQRT("-1") case above: it exercises the same "omit the zero real part" rule on the same axis, and all four LibreOffice builds agree on it -- which is what isolates the 24.8-to-25.2 change to the coefficient-of-one rule specifically, rather than to the handling of negative reals in general. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Mismatch |
| =IMSQRT("4") | sqrt(4) = 2, a real result printed with no imaginary term | 2 | 2ProvenanceExact: theta = 0, so the answer is 2 + 0i. The imaginary part vanishes and the format collapses the result to a bare "2" -- the complement of the two negative-real cases above, which drop the real part instead. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Matched |
| =IMSQRT("i") | sqrt(i), whose two parts are mathematically identical | 0.707106781186548+0.707106781186547i | 0.707106781186548+0.707106781186548iProvenanceExact: r = 1 and theta = pi/2, so the answer is cos(pi/4) + i*sin(pi/4), and cos(pi/4) = sin(pi/4) = sqrt(2)/2 = 0.707106781186547524401 EXACTLY -- the two parts are the same number. That is why this case is worth asserting: the two coefficients must be printed identically, and any engine whose polar route computes them along different paths will show it here in the last digit. (Python's own cmath.sqrt does exactly that, returning 0.7071067811865476 for the real part and 0.7071067811865475 for the imaginary one; all four LibreOffice builds print both as 0.707106781186548, which is the correctly-rounded value.) EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Mismatch |
Google Sheets (executed 2026-08-31 via Drive import)
Google Sheets is a rolling service with no pinnable version, so this run is identified by its date. The corpus was imported to Drive as .xlsx, recalculated by Sheets, and exported back for readback.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =IMSQRT("1+i") | Microsoft's documented worked example: the square root of 1+i | 1.09868411346781+0.455089860562227i | 1.09868411346781+0.455089860562227iProvenanceMicrosoft publishes '=IMSQRT("1+i")' with the result 1.09868411346781+0.455089860562227i. Derived independently with mpmath at 40 digits from the polar identity the page renders as images -- sqrt(z) = sqrt(r)(cos(theta/2) + i*sin(theta/2)) with r = |z| and theta = arg(z): r = sqrt(2), theta = pi/4, so the answer is 2^(1/4)cos(pi/8) + i*2^(1/4)sin(pi/8) = 1.09868411346780996604 + 0.455089860562227341304i. Cross-check without any trigonometry: squaring the asserted pair reproduces the argument -- 1.09868411346781^2 - 0.455089860562227^2 = 1.0000000000000004 and 2 x 1.09868411346781 x 0.455089860562227 = 0.9999999999999993, i.e. 1+i back to fifteen digits. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Matched |
| =IMSQRT("-1") | sqrt(-1) = i, the one result whose printed form is a bare imaginary unit | 6.12323399573677E-17+i | iProvenanceExact and definitional: the principal square root of -1 is i. In the documented polar form r = 1 and theta = pi, so the answer is cos(pi/2) + i*sin(pi/2) = 0 + 1i, with a real part of exactly zero and an imaginary coefficient of exactly 1. Excel's format therefore drops the real term entirely AND drops the digit 1, printing "i". EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. CROSS-VERSION DRIFT: THIS IS THE CASE THAT MOVES. The four pinned builds do not agree on this formula. 24.2.0.3 and 24.8.7.2 return "1i"; 25.2.0.3 and 25.8.7.3 return "i". Excel's documented format prints a coefficient of exactly 1 as "i" with no digit -- the rule this corpus validated against twenty published Microsoft strings, among them IMSUB("13+4i","5+3i") = "8+i" on Microsoft's own IMSUB page, where the imaginary coefficient is likewise exactly 1 and is likewise printed with no digit. So the newer builds are right and the older ones are wrong, and the change landed somewhere between 24.8.7.2 and 25.2.0.3. The NUMBER is identical on all four builds; only its rendering changed, so this is recorded as a formatting-only difference and not as a value error. It matters anyway: IM* functions return TEXT, so =IMSQRT("-1")="i" is FALSE on 24.2/24.8 and TRUE on 25.2/25.8, and any formula that compares, matches or joins these strings changes its answer when the workbook moves between releases. |
Mismatch |
| =IMSQRT("-4") | sqrt(-4) = 2i, the same branch of the format rule but with a coefficient that is not 1 | 1.22464679914735E-16+2i | 2iProvenanceExact: r = 4, theta = pi, so the answer is 2(cos(pi/2) + i*sin(pi/2)) = 0 + 2i. The real part is exactly zero and is dropped, but the coefficient is 2, so it IS printed. This case is the control for the IMSQRT("-1") case above: it exercises the same "omit the zero real part" rule on the same axis, and all four LibreOffice builds agree on it -- which is what isolates the 24.8-to-25.2 change to the coefficient-of-one rule specifically, rather than to the handling of negative reals in general. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Mismatch |
| =IMSQRT("4") | sqrt(4) = 2, a real result printed with no imaginary term | 2 | 2ProvenanceExact: theta = 0, so the answer is 2 + 0i. The imaginary part vanishes and the format collapses the result to a bare "2" -- the complement of the two negative-real cases above, which drop the real part instead. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Matched |
| =IMSQRT("i") | sqrt(i), whose two parts are mathematically identical | 0.707106781186548+0.707106781186548i | 0.707106781186548+0.707106781186548iProvenanceExact: r = 1 and theta = pi/2, so the answer is cos(pi/4) + i*sin(pi/4), and cos(pi/4) = sin(pi/4) = sqrt(2)/2 = 0.707106781186547524401 EXACTLY -- the two parts are the same number. That is why this case is worth asserting: the two coefficients must be printed identically, and any engine whose polar route computes them along different paths will show it here in the last digit. (Python's own cmath.sqrt does exactly that, returning 0.7071067811865476 for the real part and 0.7071067811865475 for the imaginary one; all four LibreOffice builds print both as 0.707106781186548, which is the correctly-rounded value.) EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Matched |
LibreOffice Calc 25.8.7.3 (tested 2026-08-31)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =IMSQRT("1+i") | Microsoft's documented worked example: the square root of 1+i | 1.09868411346781+0.455089860562227i | 1.09868411346781+0.455089860562227iProvenanceMicrosoft publishes '=IMSQRT("1+i")' with the result 1.09868411346781+0.455089860562227i. Derived independently with mpmath at 40 digits from the polar identity the page renders as images -- sqrt(z) = sqrt(r)(cos(theta/2) + i*sin(theta/2)) with r = |z| and theta = arg(z): r = sqrt(2), theta = pi/4, so the answer is 2^(1/4)cos(pi/8) + i*2^(1/4)sin(pi/8) = 1.09868411346780996604 + 0.455089860562227341304i. Cross-check without any trigonometry: squaring the asserted pair reproduces the argument -- 1.09868411346781^2 - 0.455089860562227^2 = 1.0000000000000004 and 2 x 1.09868411346781 x 0.455089860562227 = 0.9999999999999993, i.e. 1+i back to fifteen digits. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Matched |
| =IMSQRT("-1") | sqrt(-1) = i, the one result whose printed form is a bare imaginary unit | i | iProvenanceExact and definitional: the principal square root of -1 is i. In the documented polar form r = 1 and theta = pi, so the answer is cos(pi/2) + i*sin(pi/2) = 0 + 1i, with a real part of exactly zero and an imaginary coefficient of exactly 1. Excel's format therefore drops the real term entirely AND drops the digit 1, printing "i". EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. CROSS-VERSION DRIFT: THIS IS THE CASE THAT MOVES. The four pinned builds do not agree on this formula. 24.2.0.3 and 24.8.7.2 return "1i"; 25.2.0.3 and 25.8.7.3 return "i". Excel's documented format prints a coefficient of exactly 1 as "i" with no digit -- the rule this corpus validated against twenty published Microsoft strings, among them IMSUB("13+4i","5+3i") = "8+i" on Microsoft's own IMSUB page, where the imaginary coefficient is likewise exactly 1 and is likewise printed with no digit. So the newer builds are right and the older ones are wrong, and the change landed somewhere between 24.8.7.2 and 25.2.0.3. The NUMBER is identical on all four builds; only its rendering changed, so this is recorded as a formatting-only difference and not as a value error. It matters anyway: IM* functions return TEXT, so =IMSQRT("-1")="i" is FALSE on 24.2/24.8 and TRUE on 25.2/25.8, and any formula that compares, matches or joins these strings changes its answer when the workbook moves between releases. |
Matched |
| =IMSQRT("-4") | sqrt(-4) = 2i, the same branch of the format rule but with a coefficient that is not 1 | 2i | 2iProvenanceExact: r = 4, theta = pi, so the answer is 2(cos(pi/2) + i*sin(pi/2)) = 0 + 2i. The real part is exactly zero and is dropped, but the coefficient is 2, so it IS printed. This case is the control for the IMSQRT("-1") case above: it exercises the same "omit the zero real part" rule on the same axis, and all four LibreOffice builds agree on it -- which is what isolates the 24.8-to-25.2 change to the coefficient-of-one rule specifically, rather than to the handling of negative reals in general. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Matched |
| =IMSQRT("4") | sqrt(4) = 2, a real result printed with no imaginary term | 2 | 2ProvenanceExact: theta = 0, so the answer is 2 + 0i. The imaginary part vanishes and the format collapses the result to a bare "2" -- the complement of the two negative-real cases above, which drop the real part instead. EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Matched |
| =IMSQRT("i") | sqrt(i), whose two parts are mathematically identical | 0.707106781186548+0.707106781186548i | 0.707106781186548+0.707106781186548iProvenanceExact: r = 1 and theta = pi/2, so the answer is cos(pi/4) + i*sin(pi/4), and cos(pi/4) = sin(pi/4) = sqrt(2)/2 = 0.707106781186547524401 EXACTLY -- the two parts are the same number. That is why this case is worth asserting: the two coefficients must be printed identically, and any engine whose polar route computes them along different paths will show it here in the last digit. (Python's own cmath.sqrt does exactly that, returning 0.7071067811865476 for the real part and 0.7071067811865475 for the imaginary one; all four LibreOffice builds print both as 0.707106781186548, which is the correctly-rounded value.) EXCEL'S COMPLEX-STRING FORMAT, which this corpus derives rather than assumes: a result is rendered as the real part, then the sign, then the imaginary coefficient followed by the suffix, with each part printed to at most 15 significant digits and trailing zeros stripped; a zero real part is omitted entirely, a zero imaginary part reduces the result to a bare real number, and an imaginary coefficient of exactly 1 or -1 prints as "i" / "-i" with no digit. That rule was written as a formatter in Python by batch D and validated against seven independently published Microsoft strings (IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMEXP, IMLN); batch E re-ran that validation and then extended it, reproducing THIRTEEN MORE published Microsoft strings byte for byte (IMLOG10, IMLOG2, IMPOWER, both IMPRODUCT examples, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN) before predicting anything -- twenty published strings in all. ONE REFINEMENT BATCH E HAD TO MAKE: batch D fed the formatter the EXACT value computed at 40 digits, which happened to render identically to the IEEE double for all seven of its strings. That is not true here. A spreadsheet engine holds a double, not the exact value, and two of this batch's published strings only come out right if the derivation rounds to the nearest double BEFORE formatting: IMPOWER("2+3i",3) is exactly -46+9i in exact arithmetic but Microsoft publishes -46+9.00000000000001i, which is what exp(3*ln(2+3i)) gives in double precision; and IMSEC("4+3i") has an exact real part of -0.06529402785794704644..., whose 15-digit rounding ends ...47, while the correctly-rounded double -0.065294027857947051 rounds to ...471, which is what Microsoft publishes. So every value in this batch is derived exactly with mpmath at 40 digits, THEN rounded to the double an engine actually holds, THEN formatted. String results are compared exactly, so a formatting-only difference (a trailing zero, "1i" for "i", a different digit count) fails the case and is recorded as its own divergence class, separate from a wrong numeric value. |
Matched |
Docs & syntax
- Excel (desktop): official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation
Where IMSQRT behaves differently
- SORT descending in Google Sheets: is_ascending vs sort_order
Excel's SORT takes a numeric sort_order (1/-1); Google Sheets' third argument is a boolean is_ascending. Executed, =SORT(A2:A4,1,-1) returns 10, 20, 50 in Google Sheets against 50, 20, 10 in LibreOffice 25.8.7.3 - ascending, with no error anywhere. The fix is FALSE.