mirror of
https://github.com/fluencelabs/musl
synced 2025-06-08 04:21:39 +00:00
19 lines
271 B
C
19 lines
271 B
C
|
#include "libm.h"
|
||
|
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||
|
long double nearbyintl(long double x)
|
||
|
{
|
||
|
return nearbyint(x);
|
||
|
}
|
||
|
#else
|
||
|
#include <fenv.h>
|
||
|
long double nearbyintl(long double x)
|
||
|
{
|
||
|
fenv_t e;
|
||
|
|
||
|
fegetenv(&e);
|
||
|
x = rintl(x);
|
||
|
fesetenv(&e);
|
||
|
return x;
|
||
|
}
|
||
|
#endif
|