X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fmath%2Fnearbyintl.c;fp=src%2Fmath%2Fnearbyintl.c;h=b58527c8db02ce54c8a4002b4ad40a4b0dbfc9e8;hp=0000000000000000000000000000000000000000;hb=b69f695acedd4ce2798ef9ea28d834ceccc789bd;hpb=d46cf2e14cc4df7cc75e77d7009fcb6df1f48a33 diff --git a/src/math/nearbyintl.c b/src/math/nearbyintl.c new file mode 100644 index 00000000..b58527c8 --- /dev/null +++ b/src/math/nearbyintl.c @@ -0,0 +1,18 @@ +#include "libm.h" +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 +long double nearbyintl(long double x) +{ + return nearbyint(x); +} +#else +#include +long double nearbyintl(long double x) +{ + fenv_t e; + + fegetenv(&e); + x = rintl(x); + fesetenv(&e); + return x; +} +#endif