3 package Math::BigFloat::Trace;
10 use vars qw($VERSION @ISA $PACKAGE @EXPORT_OK
11 $accuracy $precision $round_mode $div_scale);
13 @ISA = qw(Exporter Math::BigFloat);
17 use overload; # inherit overload from BigFloat
20 $accuracy = $precision = undef;
27 my $class = ref($proto) || $proto;
30 my $a = $accuracy; $a = $_[0] if defined $_[0];
31 my $p = $precision; $p = $_[1] if defined $_[1];
32 my $self = Math::BigFloat->new($value,$a,$p,$round_mode);
34 # remember, downgrading may return a BigInt, so don't meddle with class
37 print "MBF new '$value' => '$self' (",ref($self),")";
43 print "MBF import ",join(' ',@_);
46 # we catch the constants, the rest goes go BigFloat
50 push @a, $_ if $_ ne ':constant';
52 overload::constant float => sub { $self->new(shift); };
54 Math::BigFloat->import(@a); # need it for subclasses
55 # $self->export_to_level(1,$self,@_); # need this ?