Skip to content

floating point types have an incorrect implementation of Eq and Ord #12434

Closed
@thestinger

Description

@thestinger

There are two solutions available:

  • implement the total ordering for Eq and Ord, and offer the traditional comparison operators via intrinsics and the Float trait
  • drop the implementations of Eq, Ord and traits inheriting from these like Num (alternate types could implement the total ordering)

Either way, it's an ugly mess. I no longer think a consensus can be reached to change the definition of the operators to using the totalOrder predicate due to both performance concerns and the desire to have the usual semantics so that's not part of the RFC.

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