diff options
Diffstat (limited to 'unit-tests/cond-cmp-numeric-eq.mk')
-rwxr-xr-x | unit-tests/cond-cmp-numeric-eq.mk | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/unit-tests/cond-cmp-numeric-eq.mk b/unit-tests/cond-cmp-numeric-eq.mk index 0e77d364ac94..c6b39876e75e 100755 --- a/unit-tests/cond-cmp-numeric-eq.mk +++ b/unit-tests/cond-cmp-numeric-eq.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-cmp-numeric-eq.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $ +# $NetBSD: cond-cmp-numeric-eq.mk,v 1.5 2020/11/08 21:47:59 rillig Exp $ # # Tests for numeric comparisons with the == operator in .if conditions. @@ -49,6 +49,19 @@ . error .endif +# Because an IEEE 754 double can only hold integers with a mantissa of 53 +# bits, these two numbers are considered the same. The 993 is rounded down +# to the 992. +.if 9007199254740993 == 9007199254740992 +.else +. error +.endif +# The 995 is rounded up, the 997 is rounded down. +.if 9007199254740995 == 9007199254740997 +.else +. error Probably a misconfiguration in the floating point environment, \ + or maybe a machine without IEEE 754 floating point support. +.endif # There is no = operator for numbers. .if !(12345 = 12345) |