Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

sqrt, sqrtf, sqrtl - square root function

&pagelevel(4)&pagelevel

Syntax

#include <math.h>

C11
double sqrt(double x);
float sqrtf(float x);
long double sqrtf(long double x); (End) 

Description

These functions compute the square root of a non-negative floating-point number x.

Return val.

sqrt(x)

if x > = 0.

 

0

if x is negative.
errno is set to indicate the error.

Errors

sqrt(), sqrtf() and sqrtl() will fail if: 


EDOM

The value of x is negative.

See also

exp(), hypot(), log(), log10(), pow(), sinh(), math.h.