File: BareCalc.pm

package info (click to toggle)
perl 5.8.4-8sarge6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 58,128 kB
  • ctags: 31,422
  • sloc: perl: 224,262; ansic: 155,398; sh: 32,253; pascal: 7,747; lisp: 6,121; makefile: 2,341; cpp: 2,035; yacc: 1,019; java: 23
file content (44 lines) | stat: -rw-r--r-- 886 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package Math::BigInt::BareCalc;

use 5.005;
use strict;
# use warnings;	# dont use warnings for older Perls

require Exporter;
use vars qw/@ISA $VERSION/;
@ISA = qw(Exporter);

$VERSION = '0.02';

sub api_version () { 1; }

# Package to to test Bigint's simulation of Calc

# uses Calc, but only features the strictly necc. methods.

use Math::BigInt::Calc '0.40';

BEGIN
  {
  no strict 'refs';
  foreach (qw/	
	base_len new zero one two ten copy str num add sub mul div mod inc dec
	acmp len digit zeros
	rsft lsft
	fac pow gcd log_int sqrt root
	is_zero is_one is_odd is_even is_one is_two is_ten check
	as_hex as_bin from_hex from_bin	
	modpow modinv
	and xor or
	/)
    {
    my $name  = "Math::BigInt::Calc::_$_";
    *{"Math::BigInt::BareCalc::_$_"} = \&$name;
    }
  print "# BareCalc using Calc v$Math::BigInt::Calc::VERSION\n";
  }

# catch and throw away
sub import { }

1;