summaryrefslogtreecommitdiff
path: root/src/math/nearbyint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/nearbyint.c')
-rw-r--r--src/math/nearbyint.c6
1 files changed, 6 insertions, 0 deletions
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;
}