1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 14:07:45 +00:00

LibM: Implement the frexp family

This commit is contained in:
Mițca Dumitru 2021-03-07 23:21:39 +02:00 committed by Andreas Kling
parent b274120b3c
commit 88d342d007

View file

@ -663,22 +663,22 @@ long double log2l(long double x) NOEXCEPT
return log2(x); return log2(x);
} }
double frexp(double, int*) NOEXCEPT double frexp(double x, int* exp) NOEXCEPT
{ {
VERIFY_NOT_REACHED(); *exp = (x == 0) ? 0 : (1 + ilogb(x));
return 0; return scalbn(x, -(*exp));
} }
float frexpf(float, int*) NOEXCEPT float frexpf(float x, int* exp) NOEXCEPT
{ {
VERIFY_NOT_REACHED(); *exp = (x == 0) ? 0 : (1 + ilogbf(x));
return 0; return scalbnf(x, -(*exp));
} }
long double frexpl(long double, int*) NOEXCEPT long double frexpl(long double x, int* exp) NOEXCEPT
{ {
VERIFY_NOT_REACHED(); *exp = (x == 0) ? 0 : (1 + ilogbl(x));
return 0; return scalbnl(x, -(*exp));
} }
double round(double value) NOEXCEPT double round(double value) NOEXCEPT