Skip to content

OrderedFloat comparison with f32/f64 is not total #143

@orlp

Description

@orlp

Is it intended that OrderedFloat(x) == y where x, y are float types is not a total comparison? This only matters for NaN: OrderedFloat(f32::NAN) == OrderedFloat(f32::NAN) is true, but OrderedFloat(f32::NAN) == f32::NAN is false.

On another note, why is PartialEq<Rhs=T> for OrderedFloat<T> implemented, but the same does not hold true for PartialOrd<Rhs=T> for OrderedFloat<T>?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions