sqrt [C++ Reference]
Keywords: c,math,sqrt
Date: 2009-03-19T23:47:40-0700

[[sqrt]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## sqrt

Syntax:

        #include <cmath>
        double sqrt( double num );

The sqrt() function returns the square root of num. If num is negative, a domain error occurs.

C++ also provides the following overloaded forms:

        #include <cmath>
        float sqrt( float num ); // same as sqrtf() in C99
        long double sqrt( long double num ); // same as sqrtl() in C99

Related Topics: exp, log, pow

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •