diff options
author | 1999-04-29 22:36:41 +0000 | |
---|---|---|
committer | 1999-04-29 22:36:41 +0000 | |
commit | 0a5f61bb653fdff7c29c2275df78c7f019a04c0c (patch) | |
tree | 0b6e610f8913b7c1e30fd7bf5bfc62edcbbd93e5 /gnu/usr.bin/perl/lib/Math/BigFloat.pm | |
parent | Y2K fix: allow 'shutdown yymmddhhmm' to work in the next century. (diff) | |
download | wireguard-openbsd-0a5f61bb653fdff7c29c2275df78c7f019a04c0c.tar.xz wireguard-openbsd-0a5f61bb653fdff7c29c2275df78c7f019a04c0c.zip |
perl5.005_03
Diffstat (limited to 'gnu/usr.bin/perl/lib/Math/BigFloat.pm')
-rw-r--r-- | gnu/usr.bin/perl/lib/Math/BigFloat.pm | 7 |
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' |