2002-07-29 11:00:10 +08:00
|
|
|
#include <math.h>
|
|
|
|
#include <errno.h>
|
2004-02-01 10:52:21 +08:00
|
|
|
|
2002-07-29 11:00:10 +08:00
|
|
|
long double ldexpl(long double x, int expn)
|
|
|
|
{
|
2004-02-01 10:52:21 +08:00
|
|
|
long double res;
|
|
|
|
if (!isfinite (x) || x == 0.0L)
|
|
|
|
return x;
|
|
|
|
|
|
|
|
__asm__ ("fscale"
|
|
|
|
: "=t" (res)
|
|
|
|
: "0" (x), "u" ((long double) expn));
|
|
|
|
|
|
|
|
if (!isfinite (res) || res == 0.0L)
|
|
|
|
errno = ERANGE;
|
|
|
|
|
|
|
|
return res;
|
2002-07-29 11:00:10 +08:00
|
|
|
}
|
|
|
|
|