summaryrefslogtreecommitdiff
path: root/src/fenv/fesetround.c
blob: 4e2f164dd5e12d1d866d88e9203c1c1d76f969f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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);
}