UNPKG

@mojir/lits

Version:

Lits is a pure functional programming language implemented in TypeScript

9 lines (8 loc) 284 B
/** * Calculates the trace of a square matrix. * The trace is defined as the sum of the elements on the main diagonal. * * @param matrix - A 2D array representing a square matrix. * @returns The trace of the matrix. */ export declare function trace(matrix: number[][]): number;