projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add PTRACE_PEEKSIGINFO to ptrace.h
[musl]
/
src
/
math
/
nearbyintl.c
diff --git
a/src/math/nearbyintl.c
b/src/math/nearbyintl.c
index
b58527c
..
8285249
100644
(file)
--- a/
src/math/nearbyintl.c
+++ b/
src/math/nearbyintl.c
@@
-1,4
+1,6
@@
-#include "libm.h"
+#include <math.h>
+#include <float.h>
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double nearbyintl(long double x)
{
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double nearbyintl(long double x)
{
@@
-8,11
+10,17
@@
long double nearbyintl(long double x)
#include <fenv.h>
long double nearbyintl(long double x)
{
#include <fenv.h>
long double nearbyintl(long double x)
{
- fenv_t e;
+#ifdef FE_INEXACT
+ #pragma STDC FENV_ACCESS ON
+ int e;
- fegetenv(&e);
+ e = fetestexcept(FE_INEXACT);
+#endif
x = rintl(x);
x = rintl(x);
- fesetenv(&e);
+#ifdef FE_INEXACT
+ if (!e)
+ feclearexcept(FE_INEXACT);
+#endif
return x;
}
#endif
return x;
}
#endif