-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
The issues section is used only for bug reports. Please use the Discussions section to ask questions and share ideas and suggestions.
Describe the bug
A clear and concise description of what the bug is.
Attempting to do mathjs.det() of a 0x0 matrix returns the following error:
RangeError: Matrix must be square (size: [0])
According to some mathy folks, the determinant of an empty matrix should be (by definition) 1: https://math.stackexchange.com/questions/1762537/why-is-the-determinant-of-the-0x0-matrix-equal-1
I'm not a mathematician, but as long as you agree with this rule that was described in the above post, I imagine this would be an extremely easy fix. Just add a special case where it returns 1 if the matrix is empty and size 0.
To Reproduce
Steps to reproduce the behavior.
math.det([]);Reactions are currently unavailable