From 06696f40afe58a231e2531c8bf6d9f0dadb92e51 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 3 Mar 2019 21:25:50 -0500 Subject: outline details from C18 annex F --- src/math/nearbyint.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/math/nearbyint.c') diff --git a/src/math/nearbyint.c b/src/math/nearbyint.c index d5d2cc21..ac9417db 100644 --- a/src/math/nearbyint.c +++ b/src/math/nearbyint.c @@ -4,6 +4,12 @@ TYPE TGFN(nearbyint)(TYPE x) { + switch (fpclassify(x)) { + case FP_ZERO: return x; + case FP_INFINITE: return x; + default: break; + } + return x; } -- cgit v1.2.1