2002-07-29 11:00:10 +08:00
|
|
|
#include <math.h>
|
2002-11-09 18:44:02 +08:00
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
extern long double __QNANL;
|
|
|
|
|
2002-07-29 11:00:10 +08:00
|
|
|
long double
|
|
|
|
sqrtl (long double x)
|
|
|
|
{
|
2002-11-09 18:44:02 +08:00
|
|
|
if (x < 0.0L )
|
|
|
|
{
|
|
|
|
errno = EDOM;
|
|
|
|
return __QNANL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
long double res;
|
|
|
|
asm ("fsqrt" : "=t" (res) : "0" (x));
|
|
|
|
return res;
|
|
|
|
}
|
2002-07-29 11:00:10 +08:00
|
|
|
}
|