提交 7b384c42 编写于 作者: S Szabolcs Nagy 提交者: Rich Felker

fix fesetround error checking

Rounding modes are not bit flags, but arbitrary non-negative integers.
上级 b3389bbf
......@@ -7,18 +7,17 @@ hidden int __fesetround(int);
int fesetround(int r)
{
if (r & ~(
FE_TONEAREST
if (r != FE_TONEAREST
#ifdef FE_DOWNWARD
|FE_DOWNWARD
&& r != FE_DOWNWARD
#endif
#ifdef FE_UPWARD
|FE_UPWARD
&& r != FE_UPWARD
#endif
#ifdef FE_TOWARDZERO
|FE_TOWARDZERO
&& r != FE_TOWARDZERO
#endif
))
)
return -1;
return __fesetround(r);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册