From: Tels Date: Thu, 11 Jul 2002 18:44:29 +0000 (+0200) Subject: Re: BigInt and "\n" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=723d369be9d12e24783142396dae96a04cd0ca6a;p=p5sagit%2Fp5-mst-13.2.git Re: BigInt and "\n" Date: Thu, 11 Jul 2002 18:44:29 +0200 (CEST) p4raw-id: //depot/perl@17487 --- diff --git a/lib/Math/BigFloat.pm b/lib/Math/BigFloat.pm index 8f80424..a12cf28 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 333f491..800a97f 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. +strings of the form C. -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 and