Boost logo

Boost :

From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2003-04-17 04:30:52

Ross Smith <r-smith_at_[hidden]> writes:


| | The pow functions
| | Synopsis
| | #include <math.h>
| | double pow(double x, double y);
| | float powf(float x, float y);
| | long double powl(long double x, long double y);
| | Description
| | The pow functions compute x raised to the power y. A domain error
| | occurs if x is finite and negative and y is finite and not an
| | integer value. A domain error may occur if x is zero and y is less
| | than or equal to zero. A range error may occur.
| | Returns
| | y
| | The pow functions return x .
| C99 has no separate integer-exponent version of pow(), that one is
| purely a C++ artifact.


That C99 does not have integer-exponent version of pow() is a
deficient from my point of view. And in effect, C library
implementations do internal checks to see whether the exponent is an
integer and branch accordingly. I see the lack of that function in C
as an indirect consequence of lacking overloading.

-- Gaby

Boost list run by bdawes at, gregod at, cpdaniel at, john at