Skip to content

Float equality is inconsistent. #2362

Description

@rupertlssmith
> let
|   p = (0/0, 1)
|   q = (0/0, 1)
| in
|   p == q
|   
False : Bool
> let
|   p = (0/0, 1)
| in
|   p == p
|   
True : Bool

Since NaN does not equal NaN, Float is not reflexive under equality. Therefore a quick object pointer comparison leads to inconsistency, the same values are equal one way, and not the other.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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