You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For scalars, we throw when sqrting a negative unless the negative is of a complex type in which case we return a complex result. IMO that is a much better solution. Switching to that would be breaking in the case of square rooting real matrices with negative real eigenvalues.
The text was updated successfully, but these errors were encountered:
A non-breaking change could be to pass an additional argument, e.g. sqrt(A, Real) if you want a real result (throwing an exception if not real) and sqrt(A, Complex) if you want a complex result (even if the result is real).
Note that eigen (and eigvals and eigvecs) have the same issue — for a real matrix, they return real matrices/vectors if possible and complex matrices/vectors if not. So any change to sqrt should probably be mirrored there.
For scalars, we throw when
sqrt
ing a negative unless the negative is of a complex type in which case we return a complex result. IMO that is a much better solution. Switching to that would be breaking in the case of square rooting real matrices with negative real eigenvalues.The text was updated successfully, but these errors were encountered: