提交 d09a83f6 编写于 作者: N nsz

fmal bug fix: nan input should not raise exception

上级 b1cbd707
...@@ -173,14 +173,14 @@ long double fmal(long double x, long double y, long double z) ...@@ -173,14 +173,14 @@ long double fmal(long double x, long double y, long double z)
* return values here are crucial in handling special cases involving * return values here are crucial in handling special cases involving
* infinities, NaNs, overflows, and signed zeroes correctly. * infinities, NaNs, overflows, and signed zeroes correctly.
*/ */
if (x == 0.0 || y == 0.0)
return (x * y + z);
if (z == 0.0)
return (x * y);
if (!isfinite(x) || !isfinite(y)) if (!isfinite(x) || !isfinite(y))
return (x * y + z); return (x * y + z);
if (!isfinite(z)) if (!isfinite(z))
return (z); return (z);
if (x == 0.0 || y == 0.0)
return (x * y + z);
if (z == 0.0)
return (x * y);
xs = frexpl(x, &ex); xs = frexpl(x, &ex);
ys = frexpl(y, &ey); ys = frexpl(y, &ey);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册