Copyright © 1997 The Open Group

sqrt - square root function

`#include <math.h> double sqrt(double`

x);

Thesqrt()function computes the square root ofx,_{}An application wishing to check for error situations should set

errnoto 0 before callingsqrt(). Iferrnois non-zero on return, or the return value is NaN, an error has occurred.

Upon successful completion,sqrt()returns the square root ofx.If

xis NaN, NaN is returned anderrnomay be set to [EDOM].If

xis negative, 0.0 or NaN is returned anderrnois set to [EDOM].

Thesqrt()function will fail if:

- [EDOM]
- The value of
xis negative.The

sqrt()function may fail if:

- [EDOM]
- The value of
xis NaN.No other errors will occur.

None.

None.

None.

isnan(),<math.h>,<stdio.h>.

Derived from Issue 1 of the SVID.

Copyright © 1997 The Open Group

[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]