3 package Math::BigInt::Subclass;
9 use Math::BigInt (1.64);
10 # $lib is for the "lib => " test
11 use vars qw($VERSION @ISA $PACKAGE @EXPORT_OK
13 $accuracy $precision $round_mode $div_scale);
15 @ISA = qw(Exporter Math::BigInt);
16 @EXPORT_OK = qw(bgcd objectify);
20 use overload; # inherit overload from BigInt
23 $accuracy = $precision = undef;
31 my $class = ref($proto) || $proto;
34 my $a = $accuracy; $a = $_[0] if defined $_[0];
35 my $p = $precision; $p = $_[1] if defined $_[1];
36 my $self = Math::BigInt->new($value,$a,$p,$round_mode);
38 $self->{'_custom'} = 1; # make sure this never goes away
44 Math::BigInt::bgcd(@_);
49 Math::BigInt::blcm(@_);
54 *objectify = \&Math::BigInt::objectify;
56 # these are called by AUTOLOAD from BigFloat, so we need at least these.
57 # We cheat, of course..
58 *bneg = \&Math::BigInt::bneg;
59 *babs = \&Math::BigInt::babs;
60 *bnan = \&Math::BigInt::bnan;
61 *binf = \&Math::BigInt::binf;
62 *bzero = \&Math::BigInt::bzero;
63 *bone = \&Math::BigInt::bone;
73 # remove the "lib => foo" parameters and store it
74 $lib = $_, $t = 0, next if $t == 1;
81 $self->SUPER::import(@a); # need it for subclasses
82 $self->export_to_level(1,$self,@a); # need this ?