diff options
author | Tels <nospam-abuse@bloodgate.com> | 2002-01-08 04:09:34 +0100 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2002-01-08 03:38:40 +0000 |
commit | 61f5c3f5cfd14120ba4a24ff8df561b16e9c906b (patch) | |
tree | 0b8ddf498bc6b377b1288599e65434635286b6ff /t/lib | |
parent | 832705d49ab18eb2b35edbacb1510b214b5a22f5 (diff) | |
download | perl-61f5c3f5cfd14120ba4a24ff8df561b16e9c906b.tar.gz |
Math-BigInt v1.49 released
p4raw-id: //depot/perl@14131
Diffstat (limited to 't/lib')
-rw-r--r-- | t/lib/Math/BigFloat/Subclass.pm | 13 | ||||
-rw-r--r-- | t/lib/Math/BigInt/BareCalc.pm | 3 | ||||
-rw-r--r-- | t/lib/Math/BigInt/Subclass.pm | 13 |
3 files changed, 14 insertions, 15 deletions
diff --git a/t/lib/Math/BigFloat/Subclass.pm b/t/lib/Math/BigFloat/Subclass.pm index 209aa1df9d..ca9bbcecb0 100644 --- a/t/lib/Math/BigFloat/Subclass.pm +++ b/t/lib/Math/BigFloat/Subclass.pm @@ -6,13 +6,13 @@ require 5.005_02; use strict; use Exporter; -use Math::BigFloat(1.23); +use Math::BigFloat(1.27); use vars qw($VERSION @ISA $PACKAGE $accuracy $precision $round_mode $div_scale); @ISA = qw(Exporter Math::BigFloat); -$VERSION = 0.01; +$VERSION = 0.02; # Globals $accuracy = $precision = undef; @@ -25,12 +25,11 @@ sub new my $class = ref($proto) || $proto; my $value = shift; - # Set to 0 if not provided, but don't use || (this would trigger for - # a passed objects to see if they are zero) - $value = 0 if !defined $value; - + my $a = $accuracy; $a = $_[0] if defined $_[0]; + my $p = $precision; $p = $_[1] if defined $_[1]; # Store the floating point value - my $self = bless Math::BigFloat->new($value), $class; + my $self = Math::BigFloat->new($value,$a,$p,$round_mode); + bless $self, $class; $self->{'_custom'} = 1; # make sure this never goes away return $self; } diff --git a/t/lib/Math/BigInt/BareCalc.pm b/t/lib/Math/BigInt/BareCalc.pm index 9cc7e94430..7c56c4eb70 100644 --- a/t/lib/Math/BigInt/BareCalc.pm +++ b/t/lib/Math/BigInt/BareCalc.pm @@ -14,13 +14,14 @@ $VERSION = '0.02'; # uses Calc, but only features the strictly necc. methods. -use Math::BigInt::Calc v0.17; +use Math::BigInt::Calc '0.18'; BEGIN { foreach (qw/ base_len new zero one two copy str num add sub mul div inc dec acmp len digit zeros is_zero is_one is_odd is_even is_one check + to_small to_large /) { my $name = "Math::BigInt::Calc::_$_"; diff --git a/t/lib/Math/BigInt/Subclass.pm b/t/lib/Math/BigInt/Subclass.pm index 3656b9ff11..03795da8ff 100644 --- a/t/lib/Math/BigInt/Subclass.pm +++ b/t/lib/Math/BigInt/Subclass.pm @@ -6,14 +6,14 @@ require 5.005_02; use strict; use Exporter; -use Math::BigInt(1.45); +use Math::BigInt(1.49); use vars qw($VERSION @ISA $PACKAGE @EXPORT_OK $accuracy $precision $round_mode $div_scale); @ISA = qw(Exporter Math::BigInt); @EXPORT_OK = qw(bgcd); -$VERSION = 0.01; +$VERSION = 0.02; # Globals $accuracy = $precision = undef; @@ -26,10 +26,10 @@ sub new my $class = ref($proto) || $proto; my $value = shift; - $value = 0 if !defined $value; # no || 0 here! - - # Store the floating point value - my $self = bless Math::BigInt->new($value), $class; + my $a = $accuracy; $a = $_[0] if defined $_[0]; + my $p = $precision; $p = $_[1] if defined $_[1]; + my $self = Math::BigInt->new($value,$a,$p,$round_mode); + bless $self,$class; $self->{'_custom'} = 1; # make sure this never goes away return $self; } @@ -47,7 +47,6 @@ sub blcm sub import { my $self = shift; -# Math::BigInt->import(@_); $self->SUPER::import(@_); # need it for subclasses #$self->export_to_level(1,$self,@_); # need this ? } |