SDDS ToolKit Programs and Libraries for C and Python
|
This file provides the ipow function for computing integer powers of a double.
Definition in file ipow.c.
#include "mdb.h"
Go to the source code of this file.
Functions | |
double | ipow (const double x, const int64_t p) |
Compute x raised to the power p (x^p). | |
double ipow | ( | const double | x, |
const int64_t | p ) |
Compute x raised to the power p (x^p).
Uses straightforward repeated multiplication for efficiency, which can be faster than using pow() for integer exponents.
Special cases:
[in] | x | The base value. |
[in] | p | The integer exponent. |
Definition at line 33 of file ipow.c.