summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2011-04-10 16:29:42 +0000
committermartynas <martynas@openbsd.org>2011-04-10 16:29:42 +0000
commitf6caf4839e196e19226a2ccad1d4e8f7b0afd8dc (patch)
treeac38700f06df80389823f0b74311664812bd4074
parentApply some tough type-love and give rdist a chance to handle files (diff)
downloadwireguard-openbsd-f6caf4839e196e19226a2ccad1d4e8f7b0afd8dc.tar.xz
wireguard-openbsd-f6caf4839e196e19226a2ccad1d4e8f7b0afd8dc.zip
add tests for yet-another bug of netbsd implementation of lrint.
i've added only couple of values, however the whole exponent range of 52 is broken. luckily amd64 and i386 aren't affected, since they use the assembly versions which do the right thing.
-rw-r--r--regress/lib/libm/rint/rint.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/regress/lib/libm/rint/rint.c b/regress/lib/libm/rint/rint.c
index 50c11c7e314..755b86fdb5a 100644
--- a/regress/lib/libm/rint/rint.c
+++ b/regress/lib/libm/rint/rint.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rint.c,v 1.8 2011/04/10 11:10:09 martynas Exp $ */
+/* $OpenBSD: rint.c,v 1.9 2011/04/10 16:29:42 martynas Exp $ */
/* Written by Michael Shalayeff, 2003, Public domain. */
@@ -47,6 +47,9 @@ main(int argc, char *argv[])
assert(lrint(-0.0) == 0L);
assert(lrintf(-0.0) == 0L);
+ assert(llrint(4503599627370496.0) == 4503599627370496L);
+ assert(llrint(-4503599627370496.0) == -4503599627370496L);
+
fpsetround(FP_RM);
assert(lrint(-0.1) == -1L);
assert(lrintf(-0.1) == -1L);