summaryrefslogtreecommitdiffstats
path: root/winsup/mingw/mingwex/math/sqrtf.c
blob: b1029cad8455a8e1dcbc70f65dda5ba88f34d79e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <math.h>
#include <errno.h>

extern float  __QNANF;

float
sqrtf (float x)
{
  if (x < 0.0F )
    {
      errno = EDOM;
      return __QNANF;
    }
  else
    {
      float res;
      asm ("fsqrt" : "=t" (res) : "0" (x));
      return res;
    }
}