repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
iconv: add euro symbol to GBK as single byte 0x80
[musl.git]
/
src
/
math
/
nearbyintf.c
blob
092e9ffae56e96b7d24003ea9d34adb9b4ea6e0d
1
#include <fenv.h>
2
#include <math.h>
3
4
float
nearbyintf
(
float
x
)
5
{
6
#ifdef FE_INEXACT
7
#pragma STDC FENV_ACCESS ON
8
int
e
;
9
10
e
=
fetestexcept
(
FE_INEXACT
);
11
#endif
12
x
=
rintf
(
x
);
13
#ifdef FE_INEXACT
14
if
(!
e
)
15
feclearexcept
(
FE_INEXACT
);
16
#endif
17
return
x
;
18
}