Home > Article > Backend Development > What does the root sign in c++ represent?
The symbol representing the root sign in C is the sqrt function. Usage: Include the
header file. Use sqrt(n) to calculate the square root of the number n, and the result is of double type. For negative numbers, sqrt returns NaN (not a number).
The symbol representing the root in C
In the C programming language, the symbol representing the root is sqrt
Function.
Usage Example
To calculate the square root of the number n, you can use the following code:
<code class="cpp">#include <cmath> int main() { double n = 16; double result = sqrt(n); return 0; }</code>
Related Notes
sqrt
The function returns a double value even if the input is an integer. sqrt
function will return a NaN (not a number) value. The above is the detailed content of What does the root sign in c++ represent?. For more information, please follow other related articles on the PHP Chinese website!