Skip to content

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

@kpreid

Description

@kpreid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions