sqrtf.c raw

   1  #include <math.h>
   2  
   3  float sqrtf(float x)
   4  {
   5  	long double t;
   6  	/* The long double result has sufficient precision so that
   7  	 * second rounding to float still keeps the returned value
   8  	 * correctly rounded, see Pierre Roux, "Innocuous Double
   9  	 * Rounding of Basic Arithmetic Operations". */
  10  	__asm__ ("fsqrt" : "=t"(t) : "0"(x));
  11  	return (float)t;
  12  }
  13