Description
Compute rows × columns - min(rows, columns) using exact integers and return the off-diagonal count as decimal text.
Matrix shapes can be empty or have singleton axes without containing a scalar. Broadcasting expands singleton dimensions under an explicit axis-by-axis compatibility rule.
Compute rows × columns - min(rows, columns) using exact integers and return the off-diagonal count as decimal text.
When to use this tool
Use Matrix Offdiagonal Entry Count when you need a matrix shape, count, or structural entry classification.
How to use the tool and how it works
- Enter rows, columns. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read offDiagonalDecimal. Use the output convention below.
Compute rows × columns - min(rows, columns) using exact integers and return the off-diagonal count as decimal text.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| rows | Rows | Required. Safe integer; minimum 0. |
| columns | Columns | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| offDiagonalDecimal | Off Diagonal Decimal | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"rows": 3,
"columns": 4
},
"output": {
"offDiagonalDecimal": "9"
}
} Limitations and assumptions
- The rectangular main diagonal has min(rows, columns) positions; this counts locations rather than nonzero values.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Check all axes and actual data lengths when validating a complete matrix or broadcast operation.
References
Similar or alternative tools
- Matrix: Matrix Shape Degenerate Axis Tag
Allow zero dimensions.
- Matrix Block Border Shape Budget
Add addedRows and addedColumns to the core shape.