msvcrt: Use the frexp()/frexpf() implementation from the bundled musl library.

This commit is contained in:
Alexandre Julliard 2023-04-03 14:38:27 +02:00
parent b7228259f8
commit be147a806b

View file

@ -2009,32 +2009,6 @@ float CDECL floorf( float x )
return u.f;
}
/*********************************************************************
* frexpf (MSVCRT.@)
*
* Copied from musl: src/math/frexpf.c
*/
float CDECL frexpf( float x, int *e )
{
UINT32 ux = *(UINT32*)&x;
int ee = ux >> 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;
ux &= 0x807ffffful;
ux |= 0x3f000000ul;
return *(float*)&ux;
}
/*********************************************************************
* modff (MSVCRT.@)
*
@ -5079,32 +5053,6 @@ float CDECL fmaf( float x, float y, float z )
return u.f;
}
/*********************************************************************
* frexp (MSVCRT.@)
*
* Copied from musl: src/math/frexp.c
*/
double CDECL frexp( double x, int *e )
{
UINT64 ux = *(UINT64*)&x;
int ee = ux >> 52 & 0x7ff;
if (!ee) {
if (x) {
x = frexp(x * 0x1p64, e);
*e -= 64;
} else *e = 0;
return x;
} else if (ee == 0x7ff) {
return x;
}
*e = ee - 0x3fe;
ux &= 0x800fffffffffffffull;
ux |= 0x3fe0000000000000ull;
return *(double*)&ux;
}
/*********************************************************************
* modf (MSVCRT.@)
*