Skip to content

Asserts for floating point tests #70

@sunfishcode

Description

@sunfishcode

assert_eq uses ocaml's <> which returns false for -0 <> 0 and true for NaN <> x ∀x. This is the usual behavior, but for our floating point unit tests we have unusual needs: we do actually need to distinguish between -0 and 0, test for specific NaNs sometimes, and test for any NaN sometimes. What do people think of adding the following?

  • assert_eq_bits - like assert_eq, but reinterpret-casts both operands as same-size integers first
  • assert_nan - has one operand and asserts that it is a NaN (of any kind)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions