diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2011-04-10 17:06:45 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2011-04-10 17:06:45 +0000 |
commit | 5798fedbd912819b1dbb02fe5f11823cf3b7dd19 (patch) | |
tree | 7f040493d50f1453dc8a90511d4eb3acf0a96609 /regress/lib/libm/rint | |
parent | c883a5231eb5513d6e9c9babb654c150c37ec1f9 (diff) |
tsk, float version of lrint is affected by a different bug, where
the corner cases would return zero--add some more tests. assembly
versions on amd64 and i386 are fine.
Diffstat (limited to 'regress/lib/libm/rint')
-rw-r--r-- | regress/lib/libm/rint/rint.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/regress/lib/libm/rint/rint.c b/regress/lib/libm/rint/rint.c index 755b86fdb5a..775069fd01d 100644 --- a/regress/lib/libm/rint/rint.c +++ b/regress/lib/libm/rint/rint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rint.c,v 1.9 2011/04/10 16:29:42 martynas Exp $ */ +/* $OpenBSD: rint.c,v 1.10 2011/04/10 17:06:44 martynas Exp $ */ /* Written by Michael Shalayeff, 2003, Public domain. */ @@ -47,8 +47,15 @@ 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); + assert(llrint(4503599627370496.0) == 4503599627370496LL); + assert(llrintf(4503599627370496.0F) == 4503599627370496LL); + assert(llrint(-4503599627370496.0) == -4503599627370496LL); + assert(llrintf(-4503599627370496.0F) == -4503599627370496LL); + + assert(llrint(0x7ffffffffffffc00.0p0) == 0x7ffffffffffffc00LL); + assert(llrintf(0x7fffff8000000000.0p0F) == 0x7fffff8000000000LL); + assert(llrint(-0x8000000000000000.0p0) == -0x8000000000000000LL); + assert(llrintf(-0x8000000000000000.0p0F) == -0x8000000000000000LL); fpsetround(FP_RM); assert(lrint(-0.1) == -1L); |