Namespaces
Variants
Views
Actions

std::sqrt

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 09:14, 23 January 2014 by Cubbi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 
 
 
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 );
(1)
double      sqrt( double arg );
(2)
long double sqrt( long double arg );
(3)
double      sqrt( Integral arg );
(4) (since C++11)

Computes the square root of arg.

[edit] Parameters

arg - Value of a floating-point or Integral type

[edit] Return value

Square root of arg.

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

[edit] 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]