diff --git a/test/cases/math.zig b/test/cases/math.zig index 55f668049381500ae10f83c5b4048e34985c3ab8..fc1555ef14e69e73952feddc50f9e3036d382ac7 100644 --- a/test/cases/math.zig +++ b/test/cases/math.zig @@ -201,3 +201,18 @@ fn smallIntAddition() { assert(result == 0); } + +fn testFloatEquality() { + @setFnTest(this); + + const x: f64 = 0.012; + const y: f64 = x + 1.0; + + testFloatEqualityImpl(x, y); + comptime testFloatEqualityImpl(x, y); +} + +fn testFloatEqualityImpl(x: f64, y: f64) { + const y2 = x + 1.0; + assert(y == y2); +}