Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document max and min NaN (partial_cmp() == None) behavior #540

Open
kpreid opened this issue Dec 26, 2024 · 0 comments
Open

Document max and min NaN (partial_cmp() == None) behavior #540

kpreid opened this issue Dec 26, 2024 · 0 comments

Comments

@kpreid
Copy link
Contributor

kpreid commented Dec 26, 2024

The max() and min() functions in approxord and on vector types do not follow the behavior of f64::max when the element type is a float:

If one of the arguments is NaN, then the other argument is returned. This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs

Instead, they return the second argument, which may be the one that is NaN. This behavior should be documented, since it is non-commutative, and potentially surprising, particularly when one is thinking about floats rather than the fact that Point3D etc. are generic types whose methods must use traits of the component type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant