Subject: | bdiv and bmode broken!!! |
Perl version 5.005 (sun4-solaris)
uname -a : SunOS censored 5.7 Generic_106541-16 sun4u sparc SUNW,Ultra-5_10
Code example:
-------------------------------------
#!/bin/sh
eval "exec perl -x $0 $* "
#!perl
require Math::BigInt;
$x = Math::BigInt->new('123123123212317256961');
$y = Math::BigInt->new('65536');
($q,$r) = $x->copy->bdiv($y);
print "X = $x\n";
print "Y = $y\n";
print "Q = $q\n";
print "R = $r\n";
$y1 = $q*$y+$r;
print "Y1 = $y1\n";
($y1 == $y) || die "Got a situation here\n";
------------------------------------------------
Results:
X = 123123123212317256961
Y = 65536
Q = 1878709769999958
R = 65535
Y1 = 123123123486717313023
Got a situation here