msvcrt: Use __scalbn helper in ldexp implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
135ae49ff4
commit
85da8da3d3
|
@ -3472,14 +3472,12 @@ int * CDECL __fpecode(void)
|
|||
*/
|
||||
double CDECL ldexp(double num, int exp)
|
||||
{
|
||||
double z = unix_funcs->ldexp(num,exp);
|
||||
double z = __scalbn(num, exp);
|
||||
|
||||
if (isfinite(num) && !isfinite(z))
|
||||
return math_error(_OVERFLOW, "ldexp", num, exp, z);
|
||||
if (num && isfinite(num) && !z)
|
||||
return math_error(_UNDERFLOW, "ldexp", num, exp, z);
|
||||
if (z == 0 && signbit(z))
|
||||
z = 0.0; /* Convert -0 -> +0 */
|
||||
return z;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,14 +138,6 @@ static float CDECL unix_hypotf(float x, float y)
|
|||
return hypotf( x, y );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* ldexp
|
||||
*/
|
||||
static double CDECL unix_ldexp(double num, int exp)
|
||||
{
|
||||
return ldexp( num, exp );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* lgamma
|
||||
*/
|
||||
|
@ -306,7 +298,6 @@ static const struct unix_funcs funcs =
|
|||
unix_frexpf,
|
||||
unix_hypot,
|
||||
unix_hypotf,
|
||||
unix_ldexp,
|
||||
unix_lgamma,
|
||||
unix_lgammaf,
|
||||
unix_log,
|
||||
|
|
|
@ -33,7 +33,6 @@ struct unix_funcs
|
|||
float (CDECL *frexpf)(float x, int *exp);
|
||||
double (CDECL *hypot)(double x, double y);
|
||||
float (CDECL *hypotf)(float x, float y);
|
||||
double (CDECL *ldexp)(double x, int exp);
|
||||
double (CDECL *lgamma)(double x);
|
||||
float (CDECL *lgammaf)(float x);
|
||||
double (CDECL *log)(double x);
|
||||
|
|
Loading…
Reference in New Issue