summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorTels <nospam-abuse@bloodgate.com>2007-06-15 21:56:10 +0200
committerSteve Hay <SteveHay@planit.com>2007-06-18 08:49:30 +0000
commit4e99e077dd977ad0b17c51278e97c808991a1de0 (patch)
tree59d6ffe545d1ae36803d3768ce4c02618411b9f7 /ext
parent42e1efa1e62f0d241a2d8e4847bce98f732060a3 (diff)
downloadperl-4e99e077dd977ad0b17c51278e97c808991a1de0.tar.gz
Re: Math::BigInt 1.87 problems? Re: FAIL DBI-1.56 i686-linux 2.4.27-3-686 [PATCH]
Message-Id: <200706151956.11861@bloodgate.com> p4raw-id: //depot/perl@31413
Diffstat (limited to 'ext')
-rw-r--r--ext/Math/BigInt/FastCalc/FastCalc.xs5
-rw-r--r--ext/Math/BigInt/FastCalc/t/bigintfc.t10
2 files changed, 11 insertions, 4 deletions
diff --git a/ext/Math/BigInt/FastCalc/FastCalc.xs b/ext/Math/BigInt/FastCalc/FastCalc.xs
index 9c2a4d34ba..3a6be8c77f 100644
--- a/ext/Math/BigInt/FastCalc/FastCalc.xs
+++ b/ext/Math/BigInt/FastCalc/FastCalc.xs
@@ -59,11 +59,10 @@ _new(class, x)
/* create the array */
RETVAL = newAV();
sv_2mortal((SV*)RETVAL);
- /* cur = SvPV(x, len); printf ("input '%s'\n", cur); */
- if (SvIOK(x) && SvIV(x) < XS_BASE)
+ if (SvIOK(x) && SvUV(x) < XS_BASE)
{
/* shortcut for integer arguments */
- av_push (RETVAL, newSViv( SvIV(x) ));
+ av_push (RETVAL, newSVuv( SvUV(x) ));
}
else
{
diff --git a/ext/Math/BigInt/FastCalc/t/bigintfc.t b/ext/Math/BigInt/FastCalc/t/bigintfc.t
index a89ed91461..2a13359ce0 100644
--- a/ext/Math/BigInt/FastCalc/t/bigintfc.t
+++ b/ext/Math/BigInt/FastCalc/t/bigintfc.t
@@ -9,7 +9,7 @@ BEGIN
chdir 't' if -d 't';
unshift @INC, '../lib'; # for running manually
unshift @INC, '../blib/arch'; # for running manually
- plan tests => 359;
+ plan tests => 361;
}
use Math::BigInt::FastCalc;
@@ -32,6 +32,14 @@ my $x = $C->_new("123"); my $y = $C->_new("321");
ok (ref($x),'ARRAY'); ok ($C->_str($x),123); ok ($C->_str($y),321);
###############################################################################
+# _new(0xffffffff) (the test is important for 32 bit Perls)
+
+my $ff = $C->_new(0xffffffff);
+
+ok ($C->_str($ff),"4294967295"); # must not be -1
+ok (scalar @{ $ff }, 2); # must be two parts
+
+###############################################################################
# _add, _sub, _mul, _div
ok ($C->_str($C->_add($x,$y)),444);
ok ($C->_str($C->_sub($x,$y)),123);