| author | |
| committer | |
| log | 8dd0b4e1f12bc9f70ff6c312b35563595fdb4476 |
| tree | 05022203182824c64c65cb5d64bbde5b04eb7743 |
| parent | 0ac1934ad64716adeb98620003a0b905fb5cfda6 |
1 files changed, 15 insertions(+), 0 deletions(-)
test/cases/math.zig+15| ... | @@ -201,3 +201,18 @@ fn smallIntAddition() { | ... | @@ -201,3 +201,18 @@ fn smallIntAddition() { |
| 201 | 201 | ||
| 202 | assert(result == 0); | 202 | assert(result == 0); |
| 203 | } | 203 | } |
| 204 | |||
| 205 | fn testFloatEquality() { | ||
| 206 | @setFnTest(this); | ||
| 207 | |||
| 208 | const x: f64 = 0.012; | ||
| 209 | const y: f64 = x + 1.0; | ||
| 210 | |||
| 211 | testFloatEqualityImpl(x, y); | ||
| 212 | comptime testFloatEqualityImpl(x, y); | ||
| 213 | } | ||
| 214 | |||
| 215 | fn testFloatEqualityImpl(x: f64, y: f64) { | ||
| 216 | const y2 = x + 1.0; | ||
| 217 | assert(y == y2); | ||
| 218 | } |