2002-07-29 05:00:10 +02:00
|
|
|
#include <math.h>
|
|
|
|
#include <errno.h>
|
2004-02-01 03:52:21 +01:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
long double ldexpl(long double x, int expn)
|
|
|
|
{
|
2004-02-01 03:52:21 +01: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 05:00:10 +02:00
|
|
|
}
|
|
|
|
|