/* 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
{
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;
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);