Copyright © 1997 The Open Group

pow - power function

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

x, doubley);

Thepow()function computes the value ofxraised to the powery,x. If^{y}xis negative,ymust be an integer value.An application wishing to check for error situations should set

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

Upon successful completion,pow()returns the value ofxraised to the powery.If

xis 0 andyis 0, 1.0 is returned.If

yis NaN, oryis non-zero andxis NaN, NaN is returned anderrnomay be set to [EDOM]. Ifyis 0.0 andxis NaN, either 1.0 is returned, or NaN is returned anderrnomay be set to [EDOM].If

xis 0.0 andyis negative, -HUGE_VAL is returned anderrnomay be set to [EDOM] or [ERANGE].If the correct value would cause overflow, ±HUGE_VAL is returned, and

errnois set to [ERANGE].If the correct value would cause underflow, 0 is returned and

errnomay be set to [ERANGE].

Thepow()function will fail if:

- [EDOM]
- The value of
xis negative andyis non-integral.- [ERANGE]
- The value to be returned would have caused overflow.
The

pow()function may fail if:

- [EDOM]
- The value of
xis 0.0 andyis negative, oryis NaN.- [ERANGE]
- The correct value would cause underflow.
No other errors will occur.

None.

None.

None.

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

Derived from Issue 1 of the SVID.

Copyright © 1997 The Open Group

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