Important: The information in this document is obsolete and should not be used for new development.
sqrt
You can use the square root (sqrt
) function to compute the square root of a real number.
double_t sqrt(double_t x);
x
- Any positive floating-point number.
DESCRIPTION
EXCEPTIONS
When x is finite and nonzero, either the result of is exact or it raises one of the following exceptions:
- inexact (if the result must be rounded)
- invalid (if x is negative)
SPECIAL CASES
Table 6-7 shows the results when the argument to the square root function is a zero, a NaN, or an Infinity, plus other special cases for the square root function. In this table, x is a finite, nonzero floating-point number.
Table 6-7 Special cases for floating-point square root Operation Result Exceptions raised NaN Invalid +0 None None NaN None[9] + None NaN Invalid
[9] If the NaN is a signaling NaN, the invalid exception is raised.