Name
pow
Synopsis
Raises a number to a power
#include <math.h> doublepow( doublex, doubley); floatpowf( floatx, floaty); (C99) long doublepowl( long doublex, long doubley); (C99)
The pow() function
calculates x to the power of
y. In other words, the return value is
xy. The
arguments are subject to the following rules:
If
xis negative,ymust have an integer value.If
xis zero, thenymust not be negative. (00 = 1.0, but for all other positive values ofy, 0y = 0.0.)
If the arguments violate these conditions, pow() may return NaN (not a number) or
infinity, and may indicate a domain error. If an overflow or
underflow occurs, pow() returns
positive or negative HUGE_VAL and
may indicate a range error.
Example
See the example for cosh() in this
chapter.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access