[perl #85334] Document actual behaviour of from_xxx() methods.
authorPeter John Acklam <pjacklam@online.no>
Sat, 5 Mar 2011 22:15:30 +0000 (14:15 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 6 Mar 2011 01:16:19 +0000 (17:16 -0800)
Add more precise documentation of the behaviour of from_oct(),
from_hex(), and from_bin().

dist/Math-BigInt/lib/Math/BigInt.pm

index 3e22d0f..e806a75 100644 (file)
@@ -3656,14 +3656,27 @@ See L<Input> for more info on accepted input formats.
 
        $x = Math::BigInt->from_oct("0775");    # input is octal
 
+Interpret the input as an octal string and return the corresponding value. A
+"0" (zero) prefix is optional. A single underscore character may be placed
+right after the prefix, if present, or between any two digits. If the input is
+invalid, a NaN is returned.
+
 =head2 from_hex()
 
        $x = Math::BigInt->from_hex("0xcafe");  # input is hexadecimal
 
+Interpret input as a hexadecimal string. A "0x" or "x" prefix is optional. A
+single underscore character may be placed right after the prefix, if present,
+or between any two digits. If the input is invalid, a NaN is returned.
+
 =head2 from_bin()
 
        $x = Math::BigInt->from_bin("0b10011"); # input is binary
 
+Interpret the input as a binary string. A "0b" or "b" prefix is optional. A
+single underscore character may be placed right after the prefix, if present,
+or between any two digits. If the input is invalid, a NaN is returned.
+
 =head2 bnan()
 
        $x = Math::BigInt->bnan();