mirror of https://git.musl-libc.org/git/musl
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
370 B
23 lines
370 B
#include <fenv.h>
|
|
#include <features.h>
|
|
|
|
/* __fesetround wrapper for arch independent argument check */
|
|
|
|
hidden int __fesetround(int);
|
|
|
|
int fesetround(int r)
|
|
{
|
|
if (r != FE_TONEAREST
|
|
#ifdef FE_DOWNWARD
|
|
&& r != FE_DOWNWARD
|
|
#endif
|
|
#ifdef FE_UPWARD
|
|
&& r != FE_UPWARD
|
|
#endif
|
|
#ifdef FE_TOWARDZERO
|
|
&& r != FE_TOWARDZERO
|
|
#endif
|
|
)
|
|
return -1;
|
|
return __fesetround(r);
|
|
}
|
|
|