Contact

MUNIT Function (OpenOffice Calc)

Math Intermediate OpenOffice Calc

Build an identity matrix with MUNIT in Apache OpenOffice Calc. Verify diagonal and off-diagonal components, dimension handling and matrix identities.

Verification status: Eight ordinary scalar or INDEX-selected reference formulas were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, through generated native ODF and GUI hard recalculation. Saved identities, inputs and results were checked. How formula examples are checked

Quick answer: =INDEX(MUNIT(1);1;1) returned 1 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 is a verified release, not a final supported version.
  • Scope: Desktop Calc, English function names and semicolon-separated formulas.
  • Checked: October 14, 2026. Eight ordinary scalar or INDEX-selected reference formulas were recalculated from generated ODF in 4.1.16 on Linux x86-64, Build 9816. Source and independent arithmetic were checked.

What MUNIT returns

MUNIT returns a square identity matrix: ones on the main diagonal and zeros elsewhere. It is not a matrix of all ones. Multiplying a compatible matrix by an identity matrix leaves it unchanged in exact arithmetic. Release implementation.

Syntax and arguments

MUNIT(Dimension)
  • Dimension: the required size n of an n×n result. Use a positive whole number.
  • The source applies its approximate-floor helper before allocating the matrix.
  • INDEX(MUNIT(n);Row;Column) selects a particular one-based entry for the reproducible scalar examples.

Eight reproducible examples

The native column contains saved 4.1.16 results; independent references use high-precision arithmetic and the stated source rules. Values are shown to twelve decimal places where needed.

Formula Native 4.1.16 result Independent reference
=INDEX(MUNIT(1);1;1) 1 1
=INDEX(MUNIT(2);1;1) 1 1
=INDEX(MUNIT(2);1;2) 0 0
=INDEX(MUNIT(2);2;1) 0 0
=INDEX(MUNIT(2);2;2) 1 1
=INDEX(MUNIT(3);3;3) 1 1
=INDEX(MUNIT(4);2;4) 0 0
=INDEX(MUNIT(2.9);2;2) 1 1

Practical worksheet

MUNIT(2) represents [[1,0],[0,1]]. Its first and fourth component examples return diagonal ones, while the two off-diagonal examples return zeros. MUNIT(1) is the one-element matrix containing 1.

For MUNIT(4), row 2 column 4 is off the diagonal and therefore zero. The native MUNIT(2.9) example selects row 2 column 2 and returns 1, consistent with the source reducing the dimension to 2. Supply an integer deliberately rather than depending on fractional-size conversion.

Advanced interpretation and checks

For any n×n matrix A, I_n×A=A×I_n=A. The determinant of I_n is 1, its inverse is itself, and its trace is n. These properties make identity matrices useful when checking an inverse or constructing a diagonal adjustment.

Adding cI_n to A changes only the diagonal entries by c; it does not add c to every cell. For example, [[1,2],[3,5]]+2I_2 is [[3,2],[3,7]]. Distinguish that operation from ordinary scalar broadcasting in a spreadsheet expression.

Boundaries and troubleshooting

The source checks for a zero dimension and an implementation matrix-size limit before allocation. The native examples use sizes 1–4 and one ordinary fractional size; zero, negative, huge and near-integer rounding cases were not executed.

An identity matrix has n² entries, so choosing a very large n can be expensive even though the construction rule is simple. The checked INDEX formulas return selected components, not a saved whole-array layout or GUI spill demonstration. Matrix dimensions and placement remain separate considerations.

Official evidence and checking scope

The generated ODF produced the informational load warning “Not all attributes could be read.” The sheet was hard-recalculated and saved separately. All eight ordinary formula identities, inputs and selected results were reconciled; a stale SUM cache changed from 999999 to 3 and an uncached SUM returned 7. This establishes the stated examples, not every workbook style, invalid input or GUI whole-array entry. INDEX wrappers select individual returned components. Other explanatory identities are independent calculations. The authoring-tool XLSX was not executed in OpenOffice, and its preview values are not the native results reported here.