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/frexpf.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/libm/frexpf.c (limited to 'lib/libm/frexpf.c') diff --git a/lib/libm/frexpf.c b/lib/libm/frexpf.c new file mode 100644 index 00000000..711129fb --- /dev/null +++ b/lib/libm/frexpf.c @@ -0,0 +1,27 @@ +#include +#include + +float frexpf(float x, int *e) +{ + union { + float f; + uint32_t i; + } y = { x }; + int ee = y.i >> 23 & 0xff; + + if (!ee) { + if (x) { + x = frexpf(x * 0x1p64, e); + *e -= 64; + } else + *e = 0; + return x; + } else if (ee == 0xff) { + return x; + } + + *e = ee - 0x7e; + y.i &= 0x807ffffful; + y.i |= 0x3f000000ul; + return y.f; +} -- cgit v1.2.3