/* Use this to compute the square root of a 16.16 fixed point number.  */
square_root(FT_16D16 val)
/* Use this to compute the square root of a 16.16 fixed point number.  */
square_root(FT_16D16 val)
{
    FT_ULong  t, q, b, r;
    r = (FT_ULong)val;
    b = 0x40000000L;
    q = 0;
    while ( b > 0x40L )
    {
      t = q + b;
      if ( r >= t )
      {
        r -= t;
        q  = t + b;
      }
      r <<= 1;
      b >>= 1;
    }
    q >>= 8;
    return (FT_16D16)q;
  }