In list context, Math::BigFloat -> bdiv() returns the quotient and remainder.
By convention, this means that the quotient and remainder, q and r, after
dividing x by y, satisfies x = q*y + r. The current behaviour is to return x/y
and r, which do not satisfy this relation, and - more importantly - is not what
people expect.
dist/Math-BigInt/lib/Math/BigFloat.pm: Patched to fix this bug.
t/bigfltpm.inc and t/upgrade.inc: Fixed test cases to match the new behaviour.
{
if ($y_not_one)
{
+ $x -> bint();
$rem->bmod($y,@params); # copy already done
}
if ($fallback)
&fdiv-list
0:0:NaN,NaN
0:1:0,0
-9:4:2.25,1
-9:5:1.8,4
+9:4:2,1
+9:5:1,4
# bug in v1.74 with bdiv in list context, when $y is 1 or -1
2.1:-1:-2.1,0
2.1:1:2.1,0
-4095:-4095:1,0
4095:-4095:-1,0
-4095:4095:-1,0
-123:2:61.5,1
-9:5:1.8,4
-9:4:2.25,1
+123:2:61,1
+9:5:1,4
+9:4:2,1
# inf handling and general remainder
-5:8:0.625,5
+5:8:0,5
0:8:0,0
-11:2:5.5,1
-11:-2:-5.5,-1
--11:2:-5.5,1
+11:2:5,1
+11:-2:-5,-1
+-11:2:-5,1
# see table in documentation in MBI
0:inf:0,0
0:-inf:0,0