Namespaces
Variants
Views
Actions

std::sqrt

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 16:44, 1 July 2013 by P12bot (Talk | contribs)

 
 
 
Common mathematical functions
Functions
Basic operations
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Exponential functions
(C++11)
(C++11)
(C++11)
(C++11)
Power functions
sqrt
(C++11)
(C++11)
Trigonometric and hyperbolic functions
(C++11)
(C++11)
(C++11)
Error and gamma functions
(C++11)
(C++11)
(C++11)
(C++11)
Nearest integer floating point operations
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Floating point manipulation functions
(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)
Classification/Comparison
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Macro constants
(C++11)(C++11)(C++11)(C++11)(C++11)
 
Defined in header <cmath>
float       sqrt( float arg );
double      sqrt( double arg );
long double sqrt( long double arg );
double      sqrt( Integral arg );
(since C++11)

Computes square root of arg.

Parameters

arg - floating point or integer value

Return value

square root of arg.

Domain error occurs if arg is negative. NAN is returned in that case.

See also

(C++11)
computes cubic root (3x)
(function) [edit]
raises a number to the given power (xy)
(function) [edit]
complex square root in the range of the right half-plane
(function template) [edit]
applies the function std::sqrt to each element of valarray
(function template) [edit]