SQRT(3) Library Functions Manual SQRT(3)

sqrtsquare root function

#include <math.h>

double
sqrt(double x);

long double
sqrtl(long double x);

float
sqrtf(float x);

The () function compute the non-negative square root of x.

sqrt(-0) returns -0.

(x) returns a NaN and generates a domain error for x < 0.

If you need to apply the sqrt() function to SIMD vectors or arrays, using the following functions provided by the Accelerate.framework may give significantly better performance:

#include <Accelerate/Accelerate.h>

vFloat (vFloat x);
vFloat (vFloat x);
void (float *y, const float *x, const int *n);
void (double *y, const double *x, const int *n);
void (float *y, const float *x, const int *n);
void (double *y, const double *x, const int *n);

math(3)

The sqrt() function conforms to ISO/IEC 9899:2011.

December 11, 2006 macOS 15.0