Skip to content

{f32,f64,float}::tests::test_abs_sub unit tests in libstd fail on Windows #8663

Closed
@vadimcn

Description

@vadimcn

f32::tests::test_abs_sub, f64::tests::test_abs_sub and float::tests::test_abs_sub in libstd fail this assertion: assert!(NaN.abs_sub(&-1f32).is_NaN()); (the result is 0 instead of NaN)

This is because mingw's implementation of underlying function fdim() does not take NaNs into account:

double fdim (double x, double y)
{
  return  (isgreater(x, y) ? (x - y) : 0.0);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions