summaryrefslogtreecommitdiff
path: root/ext/POSIX
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-11-14 19:42:21 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2014-11-14 20:07:22 -0500
commiteaa53991b995eaf492e2451b43e019d53470cdf8 (patch)
tree6930ae1107287e49f79acdf4a74134632d8ea697 /ext/POSIX
parent0d71ffa7a6afa2b69dd844fa799b8d49fc7daedc (diff)
downloadperl-eaa53991b995eaf492e2451b43e019d53470cdf8.tar.gz
fdim NaN guard.
Diffstat (limited to 'ext/POSIX')
-rw-r--r--ext/POSIX/POSIX.xs2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 923b3d3400..a9c729a138 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -643,7 +643,7 @@ static NV my_expm1(NV x)
#ifndef c99_fdim
static NV my_fdim(NV x, NV y)
{
- return x > y ? x - y : 0;
+ return (Perl_isnan(x) || Perl_isnan(y)) ? NV_NAN : (x > y ? x - y : 0);
}
# define c99_fdim my_fdim
#endif