summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-07 01:30:25 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-07 01:30:25 +0000
commit394e6ffb59de984c27a7dce4842d9c594c141888 (patch)
tree6429d67f7140ea0b59418ef189462043edc76d24 /t
parent4f8e594433baee93e2bc267827128e45c0c466c0 (diff)
downloadperl-394e6ffb59de984c27a7dce4842d9c594c141888.tar.gz
Upgrade to Math::BigInt 1.48.
p4raw-id: //depot/perl@13505
Diffstat (limited to 't')
-rw-r--r--t/lib/Math/BigFloat/Subclass.pm7
-rw-r--r--t/lib/Math/BigInt/BareCalc.pm35
-rw-r--r--t/lib/Math/BigInt/Subclass.pm5
3 files changed, 41 insertions, 6 deletions
diff --git a/t/lib/Math/BigFloat/Subclass.pm b/t/lib/Math/BigFloat/Subclass.pm
index 7a1c2790cc..209aa1df9d 100644
--- a/t/lib/Math/BigFloat/Subclass.pm
+++ b/t/lib/Math/BigFloat/Subclass.pm
@@ -24,9 +24,10 @@ sub new
my $proto = shift;
my $class = ref($proto) || $proto;
- my $value = shift || 0; # Set to 0 if not provided
- my $decimal = shift;
- my $radix = 0;
+ 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;
# Store the floating point value
my $self = bless Math::BigFloat->new($value), $class;
diff --git a/t/lib/Math/BigInt/BareCalc.pm b/t/lib/Math/BigInt/BareCalc.pm
new file mode 100644
index 0000000000..9cc7e94430
--- /dev/null
+++ b/t/lib/Math/BigInt/BareCalc.pm
@@ -0,0 +1,35 @@
+package Math::BigInt::BareCalc;
+
+use 5.005;
+use strict;
+# use warnings; # dont use warnings for older Perls
+
+require Exporter;
+use vars qw/@ISA $VERSION/;
+@ISA = qw(Exporter);
+
+$VERSION = '0.02';
+
+# Package to to test Bigint's simulation of Calc
+
+# uses Calc, but only features the strictly necc. methods.
+
+use Math::BigInt::Calc v0.17;
+
+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
+ /)
+ {
+ my $name = "Math::BigInt::Calc::_$_";
+ no strict 'refs';
+ *{"Math::BigInt::BareCalc::_$_"} = \&$name;
+ }
+ }
+
+# catch and throw away
+sub import { }
+
+1;
diff --git a/t/lib/Math/BigInt/Subclass.pm b/t/lib/Math/BigInt/Subclass.pm
index 79a4957d5b..3656b9ff11 100644
--- a/t/lib/Math/BigInt/Subclass.pm
+++ b/t/lib/Math/BigInt/Subclass.pm
@@ -25,9 +25,8 @@ sub new
my $proto = shift;
my $class = ref($proto) || $proto;
- my $value = shift; # no || 0 here!
- my $decimal = shift;
- my $radix = 0;
+ my $value = shift;
+ $value = 0 if !defined $value; # no || 0 here!
# Store the floating point value
my $self = bless Math::BigInt->new($value), $class;