This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #95530] BigRat int(-1/2) == 0
authorFather Chrysostomos <sprout@cpan.org>
Mon, 22 Aug 2011 20:43:59 +0000 (13:43 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 22 Aug 2011 20:44:28 +0000 (13:44 -0700)
commitd93f0209d1eb23b074952eedc905b475e18f4035
tree1722b81a3248c2a6fccf29bad34e33c2e5384e33
parentb73ad6a4f6b1c6b25e7f26598bb8aedf9fc5728d
[perl #95530] BigRat int(-1/2) == 0

Math::BigRat was trying to copy the sign of a BigRat object into a
BigInt object when converting to an integer, but without taking into
account that the number might be rounded toward zero.  This resulted
in a 0 BigInt with a negative sign, which is not actually a valid
BigInt object, as it does not support negative zero.
dist/Math-BigRat/lib/Math/BigRat.pm
dist/Math-BigRat/t/bigrat.t
pod/perldelta.pod