3 #include
"/usr/local/include/gsl/gsl_pow_int.h"
6 %include
"/usr/local/include/gsl/gsl_pow_int.h"
10 our @EXPORT_OK
= qw
/gsl_pow_2 gsl_pow_2 gsl_pow_3
11 gsl_pow_4 gsl_pow_5 gsl_pow_6
12 gsl_pow_7 gsl_pow_8 gsl_pow_9 gsl_pow_int
14 our
%EXPORT_TAGS
= ( all
=> \@EXPORT_OK
);
20 Math
::GSL
::PowInt
- Integer Power functions
24 use Math
::GSL
::PowInt qw
/gsl_pow_2 gsl_pow_4 gsl_pow_int
/;
25 print '
2**4 = ' . gsl_pow_2
(4) .
"\n";
26 print '
4**7 = ' . gsl_pow_4
(7) .
"\n";
27 print '
17**5 = ' . gsl_pow_int
(17,5) .
"\n";
31 This module implements the GSL Integer Power functions
, which allow one to
32 quickly compute a given integer raised to any real number. It contains
33 gsl_pow_2 to gsl_pow_9 and gsl_pow_int. If you need a power higher than
9, you
34 can use gsl_pow_int
, which takes a base as the first argument and power being
35 raised to as the second argument.
39 C
<use Math
::GSL
::PowInt qw
/:all
/;>
41 to use all avaible functions of the module.
45 This module is used to speed up arithmetic operations. The underlying code
46 decomposes the multiplication in the most efficient way. Since it is
47 implemented in XS
(via SWIG
), it should lend a large performance increase over
48 the Perl builtin exponentiation operator
, '
**' .
52 Would someone like to submit some benchmarks?
56 Jonathan Leto
<jonathan@leto.net
> and Thierry Moisan
<thierry.moisan@gmail.com
>
58 =head1 COPYRIGHT
AND LICENSE
60 Copyright
(C
) 2008 Jonathan Leto and Thierry Moisan
62 This program is free software
; you can redistribute it and
/or modify it
63 under the same terms as Perl itself.