summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dist/bignum/lib/bigint.pm20
-rw-r--r--lib/overload.pm6
2 files changed, 22 insertions, 4 deletions
diff --git a/dist/bignum/lib/bigint.pm b/dist/bignum/lib/bigint.pm
index 38aa7da0a4..32c88bf62c 100644
--- a/dist/bignum/lib/bigint.pm
+++ b/dist/bignum/lib/bigint.pm
@@ -1,7 +1,7 @@
package bigint;
use 5.006;
-$VERSION = '0.33';
+$VERSION = '0.34';
use Exporter;
@ISA = qw( Exporter );
@EXPORT_OK = qw( PI e bpi bexp hex oct );
@@ -328,8 +328,8 @@ bigint - Transparent BigInteger support for Perl
=head1 DESCRIPTION
-All operators (including basic math operations) are overloaded. Integer
-constants are created as proper BigInts.
+All operators (including basic math operations) except the range operator C<..>
+are overloaded. Integer constants are created as proper BigInts.
Floating point constants are truncated to integer. All parts and results of
expressions are also truncated.
@@ -608,6 +608,20 @@ This method only works on Perl v5.9.4 or later.
=over 2
+=item ranges
+
+Perl does not allow overloading of ranges, so you can neither safely use
+ranges with bigint endpoints, nor is the iterator variable a bigint.
+
+ use 5.010;
+ for my $i (12..13) {
+ for my $j (20..21) {
+ say $i ** $j; # produces a floating-point number,
+ # not a big integer
+ }
+ }
+
+
=item in_effect()
This method only works on Perl v5.9.4 or later.
diff --git a/lib/overload.pm b/lib/overload.pm
index ce339cd037..51801d643d 100644
--- a/lib/overload.pm
+++ b/lib/overload.pm
@@ -1,6 +1,6 @@
package overload;
-our $VERSION = '1.21';
+our $VERSION = '1.22';
%ops = (
with_assign => "+ - * / % ** << >> x .",
@@ -1675,6 +1675,10 @@ coincides with the current one.
Barewords are not covered by overloaded string constants.
+=item *
+
+The range operator C<..> cannot be overloaded.
+
=back
=cut