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/frexpl.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/libm/frexpl.c (limited to 'lib/libm/frexpl.c') diff --git a/lib/libm/frexpl.c b/lib/libm/frexpl.c new file mode 100644 index 00000000..102ade25 --- /dev/null +++ b/lib/libm/frexpl.c @@ -0,0 +1,30 @@ +#include "libm.h" + +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 +long double frexpl(long double x, int *e) +{ + return frexp(x, e); +} +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 +long double frexpl(long double x, int *e) +{ + union ldshape u = { x }; + int ee = u.i.se & 0x7fff; + + if (!ee) { + if (x) { + x = frexpl(x * 0x1p120, e); + *e -= 120; + } else + *e = 0; + return x; + } else if (ee == 0x7fff) { + return x; + } + + *e = ee - 0x3ffe; + u.i.se &= 0x8000; + u.i.se |= 0x3ffe; + return u.f; +} +#endif -- cgit v1.2.3