Go to the first, previous, next, last section, table of contents.


pow

Syntax

#include <math.h>

double pow(double x, double y);

Description

This function computes x^y, x raised to the power y.

Return Value

x raised to the power y. If the result overflows a double or underflows, errno is set to ERANGE. If y is NaN, the return value is NaN and errno is set to EDOM. If x and y are both 0, the return value is 1, but errno is set to EDOM. If y is a positive or a negative Infinity, the following results are returned, depending on the value of x:

x negative
the return value is NaN and errno is set to EDOM.
absolute value of x less than 1 and y is +Inf
absolute value of x greater than 1 and y is -Inf
the return value is zero.
absolute value of x less than 1 and y is -Inf
absolute value of x greater than 1 and y is +Inf
the return value is +Inf.
absolute value of x is 1
the return value is NaN and errno is set to EDOM.

Portability

ANSI, POSIX


Go to the first, previous, next, last section, table of contents.