Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #include <math.h>
  2. #include <errno.h>
  3.  
  4. extern long double  __QNANL;
  5.  
  6. long double
  7. sqrtl (long double x)
  8. {
  9.   if (x < 0.0L )
  10.     {
  11.       errno = EDOM;
  12.       return __QNANL;
  13.     }
  14.   else
  15.     {
  16.       long double res;
  17.       asm ("fsqrt" : "=t" (res) : "0" (x));
  18.       return res;
  19.     }
  20. }
  21.