* include/math.h (sqrt): Remove inline definition.
(sqrtf): Replace inline definition with prototype. (sqrtl): Likewise. * mingwex/math/sqrtf.c (sqrtf): Set domain error if argument less than zero. * mingwex/math/sqrtf.c (sqrtl): Likewise. Correct typo in 2002-10-30 ChangeLog entry.
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
|
||||
extern float __QNANF;
|
||||
|
||||
float
|
||||
sqrtf (float x)
|
||||
{
|
||||
float res;
|
||||
asm ("fsqrt" : "=t" (res) : "0" (x));
|
||||
return res;
|
||||
if (x < 0.0F )
|
||||
{
|
||||
errno = EDOM;
|
||||
return __QNANF;
|
||||
}
|
||||
else
|
||||
{
|
||||
float res;
|
||||
asm ("fsqrt" : "=t" (res) : "0" (x));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user