From 885f5974cdf65b59415837ae97f5a14ef1350670 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 9 Dec 2025 19:20:15 +0100 Subject: feat: add gzip and new headers --- lib/libm/nearbyint.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/libm/nearbyint.c (limited to 'lib/libm/nearbyint.c') diff --git a/lib/libm/nearbyint.c b/lib/libm/nearbyint.c new file mode 100644 index 00000000..b0ffcc8a --- /dev/null +++ b/lib/libm/nearbyint.c @@ -0,0 +1,20 @@ +#include +#include + +/* nearbyint is the same as rint, but it must not raise the inexact exception */ + +double nearbyint(double x) +{ +#ifdef FE_INEXACT +#pragma STDC FENV_ACCESS ON + int e; + + e = fetestexcept(FE_INEXACT); +#endif + x = rint(x); +#ifdef FE_INEXACT + if (!e) + feclearexcept(FE_INEXACT); +#endif + return x; +} -- cgit v1.2.3