Skip to content

Incorrect infinity behavior for FMA? #2468

Closed
@RalfJung

Description

@RalfJung

The following assertion passes on rustc, but fails in Miri:

fn main() {
    let neg_inf: f32 = f32::NEG_INFINITY;
    assert_eq!((-3.2f32).mul_add(2.4, neg_inf), neg_inf);
}

Miri uses the mul_add from apfloat (the Rust port of LLVM's softfloat library) to implement FMA, and somehow apfloat seems to be wrong? Cc @eddyb @workingjubilee

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