This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RT ticket #62101: as_int() returns NaN for inf
authorPeter John Acklam <pjacklam@online.no>
Fri, 5 Nov 2010 10:52:14 +0000 (11:52 +0100)
committerFlorian Ragwitz <rafl@debian.org>
Sun, 7 Nov 2010 15:01:11 +0000 (16:01 +0100)
commit3d6017f56e6b8f8227e1fd4570d7e7a67b7fc28a
treed0cae9560e492942bc3596b9e8ee6fcf75858c91
parent4f039b22bd6382064369066e22a0750cdd4976b1
RT ticket #62101: as_int() returns NaN for inf

Math::BigFloat -> binf() -> as_int() returns NaN, but should return
inf. In other words, if $x is a Math::BigFloat, then $x -> as_int()
shall return the same as Math::BigInt -> new($x). The bug appears both
for +inf and -inf.

-lib/Math/BigFloat.pm: Add two lines to catch the cases when the input
 is +/-inf and NaN, respectively.

-t/bare_mbf.t: incremented test count by 3

-t/bigfltpm.inc: add 3 tests, for +inf, -inf, and NaN

-t/bigfltpm.t: incremented test count by 3

-t/sub_mbf.t: incremented test count by 3

-t/with_sub.t: incremented test count by 3
dist/Math-BigInt/lib/Math/BigFloat.pm
dist/Math-BigInt/t/bare_mbf.t
dist/Math-BigInt/t/bigfltpm.inc
dist/Math-BigInt/t/bigfltpm.t
dist/Math-BigInt/t/sub_mbf.t
dist/Math-BigInt/t/with_sub.t