projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
nearbyint optimization (only clear inexact when necessary)
[oweals/musl.git]
/
src
/
math
/
nearbyintf.c
1
#include <fenv.h>
2
#include <math.h>
3
4
float nearbyintf(float x)
5
{
6
#ifdef FE_INEXACT
7
int e;
8
9
e = fetestexcept(FE_INEXACT);
10
#endif
11
x = rintf(x);
12
#ifdef FE_INEXACT
13
if (!e)
14
feclearexcept(FE_INEXACT);
15
#endif
16
return x;
17
}