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