Skip Menu |

This queue is for tickets about the Math-BigInt CPAN distribution.

Report information
The Basics
Id: 66633
Status: resolved
Priority: 0/
Queue: Math-BigInt

Owner: Nobody in particular
Requestors: peter.john.acklam [...]

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 1.9994

Subject: bdiv() returns incorrect remainder when BigInts are autoupgraded to BigFloats
Download (untitled) / with headers
text/plain 354b
The docs say that ($q,$r) = $x->bdiv($y) returns $q and $r so that $x = $q*$y + $r, but this does not hold in the following case: $ perl -MMath::BigInt=upgrade,Math::BigFloat -MMath::BigFloat -wle '$x = Math::BigInt->new(22); $y = Math::BigFloat->new(7); print for $x->bdiv($y)' 3.142857142857142857142857142857142857143 1 The remainder should be zero.
Download (untitled) / with headers
text/plain 242b
This is still an issue with the latest version: Show quoted text
>perl -MMath::BigInt=upgrade,Math::BigFloat -MMath::BigFloat -wle "$x =
Math::BigInt->new(22); $y = Math:: BigFloat->new(7); print for $x->bdiv($y)" 3.142857142857142857142857142857142857143 1
Download (untitled) / with headers
text/plain 213b
Math::BigFloat -> bdiv() now does what the documentation said it should do: In scalar context, it does true division. In list context, it returns an integer divisor and the remainder. Fixed in Math-BigInt-1.9994.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to