Commits
Stephen Canon committed 5f470484912
Fix sNaN behavior of .minimum, .maximum, .minimumMagnitude and .maximumMagnitude. (#3361)
* Bring the behavior of Self.minimum, .maximum, .minimumMagnitude and .maximumMagnitude in line with the IEEE 754 rules.
Specifically, if either argument is a signaling NaN, the result should be a quiet NaN. Previously, signaling NaN inputs were treated identically to quiet NaN inputs.
Some other changes folded in with this:
- Formally define which argument is returned if lhs == rhs or abs(lhs) == abs(rhs) in the case of the Magnitude versions. This guarantees that the set {min,max} is identitical to the set {lhs,rhs} so long as neither argument is NaN. This is not only a nod to formalism; it's also a critical property for generic head-tail arithmetic to simulate wider types.
- Added test coverage for these four operations.