summaryrefslogtreecommitdiff
path: root/lib/Math
diff options
context:
space:
mode:
authorTels <nospam-abuse@bloodgate.com>2002-07-11 20:44:29 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2002-07-11 15:45:33 +0000
commit723d369be9d12e24783142396dae96a04cd0ca6a (patch)
treebcdd83b09547775b589dcec2cd7207dd7e5d9f07 /lib/Math
parent9df4da27fbed528c1795e76111bdb359928b1a63 (diff)
downloadperl-723d369be9d12e24783142396dae96a04cd0ca6a.tar.gz
Re: BigInt and "\n"
Date: Thu, 11 Jul 2002 18:44:29 +0200 (CEST) p4raw-id: //depot/perl@17487
Diffstat (limited to 'lib/Math')
-rw-r--r--lib/Math/BigFloat.pm2
-rw-r--r--lib/Math/BigInt.pm14
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/Math/BigFloat.pm b/lib/Math/BigFloat.pm
index 8f80424460..a12cf28a84 100644
--- a/lib/Math/BigFloat.pm
+++ b/lib/Math/BigFloat.pm
@@ -1992,7 +1992,7 @@ Math::BigFloat - Arbitrary size floating point math package
$x->precision(); # return P of $x (or global, if P of $x undef)
$x->precision($n); # set P of $x to $n
$x->accuracy(); # return A of $x (or global, if A of $x undef)
- $x->accuracy($n); # set P $x to $n
+ $x->accuracy($n); # set A $x to $n
Math::BigFloat->precision(); # get/set global P for all BigFloat objects
Math::BigFloat->accuracy(); # get/set global A for all BigFloat objects
diff --git a/lib/Math/BigInt.pm b/lib/Math/BigInt.pm
index 333f491624..800a97f275 100644
--- a/lib/Math/BigInt.pm
+++ b/lib/Math/BigInt.pm
@@ -2806,7 +2806,7 @@ Math::BigInt - Arbitrary size integer math package
$x->precision(); # return P of $x (or global, if P of $x undef)
$x->precision($n); # set P of $x to $n
$x->accuracy(); # return A of $x (or global, if A of $x undef)
- $x->accuracy($n); # set P $x to $n
+ $x->accuracy($n); # set A $x to $n
Math::BigInt->precision(); # get/set global P for all BigInt objects
Math::BigInt->accuracy(); # get/set global A for all BigInt objects
@@ -2835,9 +2835,12 @@ zeros suppressed.
=item Input
Input values to these routines may be either Math::BigInt objects or
-strings of the form C</^\s*[+-]?[\d]+\.?[\d]*E?[+-]?[\d]*$/>.
+strings of the form C</^[+-]?[\d]+\.?[\d]*E?[+-]?[\d]*$/>.
-You can include one underscore between any two digits.
+You can include one underscore between any two digits. The input string may
+have leading and trailing whitespace, which will be ignored. In later
+versions, a more strict (no whitespace at all) or more lax (whitespace
+allowed everywhere) input checking will also be possible.
This means integer values like 1.01E2 or even 1000E-2 are also accepted.
Non integer values result in NaN.
@@ -3893,6 +3896,11 @@ versions to a more sophisticated scheme):
=over 2
+=item Input with trailing newlines
+
+Input with trailing newlines is handled wrong (e.g. lead to corrupted numbers)
+in some cases, for instance "123\n" or "123456789\n".
+
=item Out of Memory!
Under Perl prior to 5.6.0 having an C<use Math::BigInt ':constant';> and