FastCalc.pm revision 1.4
1package Math::BigInt::FastCalc;
2
3use 5.006;
4use strict;
5use warnings;
6
7use Math::BigInt::Calc 1.999801;
8
9our @ISA = qw< Math::BigInt::Calc >;
10
11our $VERSION = '0.5009';
12
13##############################################################################
14# global constants, flags and accessory
15
16# announce that we are compatible with MBI v1.83 and up
17sub api_version () { 2; }
18
19# use Calc to override the methods that we do not provide in XS
20
21require XSLoader;
22XSLoader::load(__PACKAGE__, $VERSION, Math::BigInt::Calc->_base_len());
23
24##############################################################################
25##############################################################################
26
271;
28
29__END__
30
31=pod
32
33=head1 NAME
34
35Math::BigInt::FastCalc - Math::BigInt::Calc with some XS for more speed
36
37=head1 SYNOPSIS
38
39    # to use it with Math::BigInt
40    use Math::BigInt lib => 'FastCalc';
41
42    # to use it with Math::BigFloat
43    use Math::BigFloat lib => 'FastCalc';
44
45    # to use it with Math::BigRat
46    use Math::BigRat lib => 'FastCalc';
47
48=head1 DESCRIPTION
49
50Math::BigInt::FastCalc inherits from Math::BigInt::Calc.
51
52Provides support for big integer calculations. Not intended to be used by
53other modules. Other modules which sport the same functions can also be used
54to support Math::BigInt, like L<Math::BigInt::GMP> or L<Math::BigInt::Pari>.
55
56In order to allow for multiple big integer libraries, Math::BigInt was
57rewritten to use library modules for core math routines. Any module which
58follows the same API as this can be used instead by using the following:
59
60	use Math::BigInt lib => 'libname';
61
62'libname' is either the long name ('Math::BigInt::Pari'), or only the short
63version like 'Pari'. To use this library:
64
65	use Math::BigInt lib => 'FastCalc';
66
67=head1 STORAGE
68
69Math::BigInt::FastCalc works exactly like Math::BigInt::Calc. Numbers are
70stored in decimal form chopped into parts.
71
72=head1 METHODS
73
74The following functions are now implemented in FastCalc.xs:
75
76	_is_odd		_is_even	_is_one		_is_zero
77	_is_two		_is_ten
78	_zero		_one		_two		_ten
79	_acmp		_len
80	_inc		_dec
81	__strip_zeros	_copy
82
83=head1 BUGS
84
85Please report any bugs or feature requests to
86C<bug-math-bigint-fastcalc at rt.cpan.org>, or through the web interface at
87L<https://rt.cpan.org/Ticket/Create.html?Queue=Math-BigInt-FastCalc>
88(requires login).
89We will be notified, and then you'll automatically be notified of progress on
90your bug as I make changes.
91
92=head1 SUPPORT
93
94You can find documentation for this module with the perldoc command.
95
96    perldoc Math::BigInt::FastCalc
97
98You can also look for information at:
99
100=over 4
101
102=item * RT: CPAN's request tracker
103
104L<https://rt.cpan.org/Public/Dist/Display.html?Name=Math-BigInt-FastCalc>
105
106=item * AnnoCPAN: Annotated CPAN documentation
107
108L<http://annocpan.org/dist/Math-BigInt-FastCalc>
109
110=item * CPAN Ratings
111
112L<http://cpanratings.perl.org/dist/Math-BigInt-FastCalc>
113
114=item * Search CPAN
115
116L<http://search.cpan.org/dist/Math-BigInt-FastCalc/>
117
118=item * CPAN Testers Matrix
119
120L<http://matrix.cpantesters.org/?dist=Math-BigInt-FastCalc>
121
122=item * The Bignum mailing list
123
124=over 4
125
126=item * Post to mailing list
127
128C<bignum at lists.scsys.co.uk>
129
130=item * View mailing list
131
132L<http://lists.scsys.co.uk/pipermail/bignum/>
133
134=item * Subscribe/Unsubscribe
135
136L<http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/bignum>
137
138=back
139
140=back
141
142=head1 LICENSE
143
144This program is free software; you may redistribute it and/or modify it under
145the same terms as Perl itself.
146
147=head1 AUTHORS
148
149Original math code by Mark Biggar, rewritten by Tels L<http://bloodgate.com/>
150in late 2000.
151Separated from BigInt and shaped API with the help of John Peacock.
152
153Fixed, sped-up and enhanced by Tels http://bloodgate.com 2001-2003.
154Further streamlining (api_version 1 etc.) by Tels 2004-2007.
155
156Bug-fixing by Peter John Acklam E<lt>pjacklam@online.noE<gt> 2010-2016.
157
158=head1 SEE ALSO
159
160L<Math::BigInt::Lib> for a description of the API.
161
162Alternative libraries L<Math::BigInt::Calc>, L<Math::BigInt::GMP>, and
163L<Math::BigInt::Pari>.
164
165Some of the modules that use these libraries L<Math::BigInt>,
166L<Math::BigFloat>, and L<Math::BigRat>.
167
168=cut
169