Given that lengthSquared of Quaternion is fairly prone to overflow/underflow, length (= sqrt(lengthSquared)) could yield an invalid result even if it would be perfectly representable.
This PR fixes the problem in that it handles overflow or underflow of lengthSquared when calculating length.
Given that
lengthSquared
of Quaternion is fairly prone to overflow/underflow,length
(=sqrt(lengthSquared)
) could yield an invalid result even if it would be perfectly representable. This PR fixes the problem in that it handles overflow or underflow oflengthSquared
when calculatinglength
.