This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Increase $Math::BigInt::FastCalc::VERSION to 0.31
[perl5.git] / dist / Math-BigInt-FastCalc / lib / Math / BigInt / FastCalc.pm
CommitLineData
062a4e99
T
1package Math::BigInt::FastCalc;
2
08a3f4a9 3use 5.006;
062a4e99 4use strict;
f08c1152 5use warnings;
062a4e99 6
764bcc0b 7use Math::BigInt::Calc 1.997;
062a4e99 8
85b6f04b 9use vars '$VERSION';
062a4e99 10
bdce6f37 11$VERSION = '0.31';
062a4e99 12
062a4e99
T
13##############################################################################
14# global constants, flags and accessory
15
1db682fd
PJA
16# announce that we are compatible with MBI v1.83 and up
17sub api_version () { 2; }
71f01b37 18
4dd6c65f 19# use Calc to override the methods that we do not provide in XS
062a4e99 20
4dd6c65f 21for my $method (qw/
1db682fd 22 str num
062a4e99
T
23 add sub mul div
24 rsft lsft
25 mod modpow modinv
26 gcd
5ed38b1a 27 pow root sqrt log_int fac nok
062a4e99 28 digit check
7b29e1e6 29 from_hex from_bin from_oct as_hex as_bin as_oct
08a3f4a9 30 zeros base_len
062a4e99 31 xor or and
c039cd6f 32 alen 1ex
062a4e99
T
33 /)
34 {
35 no strict 'refs';
36 *{'Math::BigInt::FastCalc::_' . $method} = \&{'Math::BigInt::Calc::_' . $method};
37 }
f800d0e1 38
c0fdee65 39require XSLoader;
85b6f04b 40XSLoader::load(__PACKAGE__, $VERSION, Math::BigInt::Calc::_base_len());
062a4e99
T
41
42##############################################################################
43##############################################################################
44
451;
46__END__
206957a7 47=pod
062a4e99
T
48
49=head1 NAME
50
51Math::BigInt::FastCalc - Math::BigInt::Calc with some XS for more speed
52
53=head1 SYNOPSIS
54
55Provides support for big integer calculations. Not intended to be used by
56other modules. Other modules which sport the same functions can also be used
57to support Math::BigInt, like L<Math::BigInt::GMP> or L<Math::BigInt::Pari>.
58
59=head1 DESCRIPTION
60
61In order to allow for multiple big integer libraries, Math::BigInt was
62rewritten to use library modules for core math routines. Any module which
63follows the same API as this can be used instead by using the following:
64
65 use Math::BigInt lib => 'libname';
66
67'libname' is either the long name ('Math::BigInt::Pari'), or only the short
68version like 'Pari'. To use this library:
69
70 use Math::BigInt lib => 'FastCalc';
71
72Note that from L<Math::BigInt> v1.76 onwards, FastCalc will be loaded
73automatically, if possible.
74
75=head1 STORAGE
76
77FastCalc works exactly like Calc, in stores the numbers in decimal form,
78chopped into parts.
79
80=head1 METHODS
81
82The following functions are now implemented in FastCalc.xs:
83
84 _is_odd _is_even _is_one _is_zero
85 _is_two _is_ten
86 _zero _one _two _ten
1db682fd 87 _acmp _len
062a4e99
T
88 _inc _dec
89 __strip_zeros _copy
90
91=head1 LICENSE
71f01b37 92
062a4e99 93This program is free software; you may redistribute it and/or modify it under
71f01b37 94the same terms as Perl itself.
062a4e99
T
95
96=head1 AUTHORS
97
98Original math code by Mark Biggar, rewritten by Tels L<http://bloodgate.com/>
99in late 2000.
c4a6f826 100Separated from BigInt and shaped API with the help of John Peacock.
824a8d2e 101
062a4e99 102Fixed, sped-up and enhanced by Tels http://bloodgate.com 2001-2003.
7b29e1e6 103Further streamlining (api_version 1 etc.) by Tels 2004-2007.
824a8d2e 104
1db682fd 105Bug-fixing by Peter John Acklam E<lt>pjacklam@online.noE<gt> 2010-2011.
062a4e99
T
106
107=head1 SEE ALSO
108
c039cd6f 109L<Math::BigInt>, L<Math::BigFloat>,
062a4e99
T
110L<Math::BigInt::GMP>, L<Math::BigInt::FastCalc> and L<Math::BigInt::Pari>.
111
112=cut