This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move Math::BigInt from ext/ to cpan/
[perl5.git] / cpan / Math-BigInt / t / Math / BigInt / BareCalc.pm
1 package Math::BigInt::BareCalc;
2
3 use 5.005;
4 use strict;
5 # use warnings; # dont use warnings for older Perls
6
7 require Exporter;
8 use vars qw/@ISA $VERSION/;
9 @ISA = qw(Exporter);
10
11 $VERSION = '0.05';
12
13 sub api_version () { 1; }
14
15 # Package to to test Bigint's simulation of Calc
16
17 # uses Calc, but only features the strictly necc. methods.
18
19 use Math::BigInt::Calc '0.51';
20
21 BEGIN
22   {
23   no strict 'refs';
24   foreach (qw/  
25         base_len new zero one two ten copy str num add sub mul div mod inc dec
26         acmp alen len digit zeros
27         rsft lsft
28         fac pow gcd log_int sqrt root
29         is_zero is_one is_odd is_even is_one is_two is_ten check
30         as_hex as_bin as_oct from_hex from_bin from_oct
31         modpow modinv
32         and xor or
33         /)
34     {
35     my $name  = "Math::BigInt::Calc::_$_";
36     *{"Math::BigInt::BareCalc::_$_"} = \&$name;
37     }
38   print "# BareCalc using Calc v$Math::BigInt::Calc::VERSION\n";
39   }
40
41 # catch and throw away
42 sub import { }
43
44 1;