https://issues.dlang.org/show_bug.cgi?id=21772
Issue ID: 21772
Summary: [REG2.069] Consecutive different-signed `double.nan`s
in an array literal take the sign of the previous nan
(same for `float` and `real`)
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Demonstration below. Bug does not appear in LDC.
---
void main()
{
import std.stdio : writeln;
import std.math : isIdentical;
double[] a = [-double.nan, double.nan, double.nan,
1.0, double.nan, -double.nan];
writeln(a); // Writes "[-nan, -nan, -nan, 1, nan, nan]" (Uh-oh!)
assert(!isIdentical(a[0], a[1])); // Fails of course.
}
---
--