IPOW 3CW "10 June 2007" "mathcw-1.00"

Table of contents


NAME

ipowf, ipow, ipowl, ipoww, ipowq, ipowll, ipowdf, ipowd, ipowdl, ipowdll - integer power function

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float ipowf (float x, float y);

extern double ipow (double x, double y);

extern long double ipowl (long double x, long double y);

extern __float80 ipoww (__float80 x, __float80 y);

extern __float128 ipowq (__float128 x, __float128 y);

extern long_long_double ipowll (long_long_double x, long_long_double y);

extern decimal_float ipowdf (decimal_float x, decimal_float y);

extern decimal_double ipowd (decimal_double x, decimal_double y);

extern decimal_long_double ipowdl (decimal_long_double x, decimal_long_double y);

extern decimal_long_long_double ipowdll (decimal_long_long_double x, decimal_long_long_double y);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the first argument raised to the integer power of the second argument by fast recursive multiplication.

Caution: Because the error magnification in exponential and power functions is proportional to the exponent, for powers that are too large or too small to represent exactly, brute-force multiplication may introduce substantial rounding errors, and the companion function family, pow(x,y), is likely to be more accurate.


RETURN VALUES

Return x**n.

ERRORS

If the first argument is a NaN, set errno to EDOM and return the NaN argument. If the result is too big to represent, return an Infinity of the appropriate sign and set errno to ERANGE. If both arguments are zero, return +1.

Although 0**0 is mathematically undefined, it is often programmatically convenient to have the rule that 0**finite and 0**infinite are always 1, and most C library implementations, including this one, behave that way, even though the C89 and C99 Standards allow 0**0 to be treated as an error.


SEE ALSO

exp(3CW), expm1(3CW), exp2(3CW), exp2m1(3CW), exp8(3CW), exp8m1(3CW), exp10(3CW), exp10m1(3CW), exp16(3CW), exp16m1(3CW), log(3CW), log1p(3CW), log2(3CW), log21p(3CW), log8(3CW), log81p(3CW), log10(3CW), log101p(3CW), log16(3CW), log161p(3CW), pow(3CW).