3 package Math::BigInt::Subclass;
9 use Math::BigInt(1.56);
10 use vars qw($VERSION @ISA $PACKAGE @EXPORT_OK
11 $accuracy $precision $round_mode $div_scale);
13 @ISA = qw(Exporter Math::BigInt);
14 @EXPORT_OK = qw(bgcd objectify);
18 use overload; # inherit overload from BigInt
21 $accuracy = $precision = undef;
28 my $class = ref($proto) || $proto;
31 my $a = $accuracy; $a = $_[0] if defined $_[0];
32 my $p = $precision; $p = $_[1] if defined $_[1];
33 my $self = Math::BigInt->new($value,$a,$p,$round_mode);
35 $self->{'_custom'} = 1; # make sure this never goes away
41 Math::BigInt::bgcd(@_);
46 Math::BigInt::blcm(@_);
51 *objectify = \&Math::BigInt::objectify;
53 # these are called by AUTOLOAD from BigFloat, so we need at least these.
54 # We cheat, of course..
55 *bneg = \&Math::BigInt::bneg;
56 *babs = \&Math::BigInt::babs;
57 *bnan = \&Math::BigInt::bnan;
58 *binf = \&Math::BigInt::binf;
59 *bzero = \&Math::BigInt::bzero;
60 *bone = \&Math::BigInt::bone;
70 $t = 0, next if $t == 1;
77 $self->SUPER::import(@a); # need it for subclasses
78 $self->export_to_level(1,$self,@a); # need this ?