summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/lib/Math/BigFloat.pm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/lib/Math/BigFloat.pm')
-rw-r--r--gnu/usr.bin/perl/lib/Math/BigFloat.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/gnu/usr.bin/perl/lib/Math/BigFloat.pm b/gnu/usr.bin/perl/lib/Math/BigFloat.pm
index 7551ad01a38..03bc2f4e271 100644
--- a/gnu/usr.bin/perl/lib/Math/BigFloat.pm
+++ b/gnu/usr.bin/perl/lib/Math/BigFloat.pm
@@ -37,7 +37,7 @@ sub numify { 0 + "${$_[0]}" } # Not needed, additional overhead
sub stringify {
my $n = ${$_[0]};
- $n =~ s/^\+//;
+ my $minus = ($n =~ s/^([+-])// && $1 eq '-');
$n =~ s/E//;
$n =~ s/([-+]\d+)$//;
@@ -52,6 +52,7 @@ sub stringify {
} else {
$n = '.' . ("0" x (abs($e) - $ln)) . $n;
}
+ $n = "-$n" if $minus;
# 1 while $n =~ s/(.*\d)(\d\d\d)/$1,$2/;
@@ -273,7 +274,7 @@ Math::BigFloat - Arbitrary length float math package
=head1 SYNOPSIS
- use Math::BogFloat;
+ use Math::BigFloat;
$f = Math::BigFloat->new($string);
$f->fadd(NSTR) return NSTR addition
@@ -300,7 +301,7 @@ floats as
=item number format
canonical strings have the form /[+-]\d+E[+-]\d+/ . Input values can
-have inbedded whitespace.
+have imbedded whitespace.
=item Error returns 'NaN'