miri
miri copied to clipboard
atan2 NaN-result mismatch
For selected NaN inputs, Miri returns a finite angle while native execution returns NaN.
Program
fn main() {
println!("atan2f={:?}", f32::NAN.atan2(f32::NEG_INFINITY));
println!("atan2={:?}", f64::NAN.atan2(0.0));
}
Output
native:
atan2f=NaN
atan2=NaN
miri:
atan2f=3.1415927
atan2=1.5707963267948966
Is there a standard somewhere saying what should happen?
The C standard says nothing about NaNs. But I tend to agree that returning a non-NaN output on a NaN input is odd.
The odd thing is that we do use native arithmetic here. I am not sure what is going on that we're not ending up forwarding the native NaN...
Thanks, I found the problem, it should be fixed soon. :)