diff options
Diffstat (limited to 'gsl-1.9/doc/specfunc-pow-int.texi')
-rw-r--r-- | gsl-1.9/doc/specfunc-pow-int.texi | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gsl-1.9/doc/specfunc-pow-int.texi b/gsl-1.9/doc/specfunc-pow-int.texi new file mode 100644 index 0000000..f05469a --- /dev/null +++ b/gsl-1.9/doc/specfunc-pow-int.texi @@ -0,0 +1,22 @@ +@cindex power function +@cindex integer powers + +The following functions are equivalent to the function @code{gsl_pow_int} +(@pxref{Small integer powers}) with an error estimate. These functions are +declared in the header file @file{gsl_sf_pow_int.h}. + +@deftypefun double gsl_sf_pow_int (double @var{x}, int @var{n}) +@deftypefunx int gsl_sf_pow_int_e (double @var{x}, int @var{n}, gsl_sf_result * @var{result}) +These routines compute the power @math{x^n} for integer @var{n}. The +power is computed using the minimum number of multiplications. For +example, @math{x^8} is computed as @math{((x^2)^2)^2}, requiring only 3 +multiplications. For reasons of efficiency, these functions do not +check for overflow or underflow conditions. +@end deftypefun + +@example +#include <gsl/gsl_sf_pow_int.h> +/* compute 3.0**12 */ +double y = gsl_sf_pow_int(3.0, 12); +@end example + |