This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade bignum from version 0.42 to 0.43
[perl5.git] / cpan / bignum / lib / Math / BigInt / Trace.pm
CommitLineData
91f07087 1#!perl
126f3c5f
JH
2
3package Math::BigInt::Trace;
4
91f07087 5require 5.006;
126f3c5f 6use strict;
91f07087 7use warnings;
126f3c5f
JH
8
9use Exporter;
10use Math::BigInt;
126f3c5f 11
91f07087 12our ($PACKAGE, @EXPORT_OK, $accuracy, $precision, $round_mode, $div_scale);
126f3c5f 13
91f07087
SH
14our @ISA = qw(Exporter Math::BigInt);
15
fb7f2fa3 16our $VERSION = '0.43';
126f3c5f 17
56e812ab 18use overload; # inherit overload from BigInt
126f3c5f
JH
19
20# Globals
21$accuracy = $precision = undef;
22$round_mode = 'even';
23$div_scale = 40;
24
56e812ab 25sub new {
91f07087
SH
26 my $proto = shift;
27 my $class = ref($proto) || $proto;
56e812ab
PJA
28
29 my $value = shift;
30 my $a = $accuracy;
31 $a = $_[0] if defined $_[0];
32 my $p = $precision;
33 $p = $_[1] if defined $_[1];
34 my $self = Math::BigInt->new($value, $a, $p, $round_mode);
35 bless $self, $class;
36 print "MBI new '$value' => '$self' (", ref($self), ")";
37 return $self;
126f3c5f
JH
38}
39
56e812ab
PJA
40sub import {
41 print "MBI import ", join(' ', @_);
42 my $self = shift;
43 Math::BigInt::import($self, @_); # need it for subclasses
44# $self->export_to_level(1, $self, @_); # need this ?
45 @_ = ();
46}
126f3c5f
JH
47
481;