aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/cond-cmp-numeric-eq.mk
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2020-11-20 03:54:37 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2020-11-20 03:54:37 +0000
commit1b65f0bd2bda7121a90f8cb4c1cacaa20f1b681d (patch)
tree90c374b8513ec5109e1ec4e2228e2edf648e8756 /unit-tests/cond-cmp-numeric-eq.mk
parent302da1a3d35c15cb29d76e0a939f8bcb13f7ad80 (diff)
Notes
Diffstat (limited to 'unit-tests/cond-cmp-numeric-eq.mk')
-rwxr-xr-xunit-tests/cond-cmp-numeric-eq.mk15
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)