summaryrefslogtreecommitdiff
path: root/dist/Math-BigInt/lib
diff options
context:
space:
mode:
authorPeter John Acklam <pjacklam@online.no>2011-03-07 11:45:38 +0100
committerFather Chrysostomos <sprout@cpan.org>2011-06-11 12:17:14 -0700
commitfc3993133139f2c4cdcfb845ec86abc53fafa050 (patch)
treeae637220890a78adcc93a94fe82e14f36e8c0a35 /dist/Math-BigInt/lib
parent66a0495875e8130c45cac4fabd5f8d05f2f4c372 (diff)
downloadperl-fc3993133139f2c4cdcfb845ec86abc53fafa050.tar.gz
Fix Math::BigFloat->numify().
Math::BigFloat->numify() shall, according to the documentation and to be consistent with Math::BigInt->numify() and Math::BigRat->numify(), return a Perl scalar number, not a string. - dist/Math-BigInt/lib/Math/BigFloat.pm: - Fix objectify(). - dist/Math-BigInt/t/bigfltpm.inc: - Remove no longer relevant tests. - Modify existing tests and add new tests to verify correct behaviour. This fix closes RT #66732.
Diffstat (limited to 'dist/Math-BigInt/lib')
-rw-r--r--dist/Math-BigInt/lib/Math/BigFloat.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/dist/Math-BigInt/lib/Math/BigFloat.pm b/dist/Math-BigInt/lib/Math/BigFloat.pm
index 06a6e48417..40881038d5 100644
--- a/dist/Math-BigInt/lib/Math/BigFloat.pm
+++ b/dist/Math-BigInt/lib/Math/BigFloat.pm
@@ -437,10 +437,10 @@ sub bsstr
sub numify
{
- # Make a number from a BigFloat object
- # simple return a string and let Perl's atoi()/atof() handle the rest
+ # Convert a Perl scalar number from a BigFloat object.
+ # Create a string and let Perl's atoi()/atof() handle the rest.
my ($self,$x) = ref($_[0]) ? (undef,$_[0]) : objectify(1,@_);
- $x->bsstr();
+ return 0 + $x->bsstr();
}
##############################################################################