diff options
author | Tels <nospam-abuse@bloodgate.com> | 2002-08-14 00:02:09 +0200 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-22 22:29:45 +0000 |
commit | b4bc5691c8dfad19b52d103e3b12af9342fcea38 (patch) | |
tree | 23ba012d3637ec64db0f0a50ac3477840a8e727b /lib/bigint.pm | |
parent | e1e1143f887ddae0f16d3743c74922bf4cc42ade (diff) | |
download | perl-b4bc5691c8dfad19b52d103e3b12af9342fcea38.tar.gz |
bignum-0.12 updates from:
Subject: [ANNOUCNE] Big Math::Big* update
Message-Id: <200208132121.g7DLLRV21408@crypt.org>
p4raw-id: //depot/perl@17758
Diffstat (limited to 'lib/bigint.pm')
-rw-r--r-- | lib/bigint.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/bigint.pm b/lib/bigint.pm index 900fe18452..fa59d3bac9 100644 --- a/lib/bigint.pm +++ b/lib/bigint.pm @@ -1,10 +1,11 @@ package bigint; require 5.005; -$VERSION = '0.02'; +$VERSION = '0.03'; use Exporter; -@ISA = qw( Exporter ); -@EXPORT_OK = qw( ); +@ISA = qw( Exporter ); +@EXPORT_OK = qw( ); +@EXPORT = qw( inf NaN ); use strict; use overload; @@ -179,22 +180,29 @@ sub import # we take care of floating point constants, since BigFloat isn't available # and BigInt doesn't like them: overload::constant float => sub { Math::BigInt->new( _constant(shift) ); }; + + $self->export_to_level(1,$self,@a); # export inf and NaN } +sub inf () { Math::BigInt->binf(); } +sub NaN () { Math::BigInt->bnan(); } + 1; __END__ =head1 NAME -bigint - Transparent big integer support for Perl +bigint - Transparent BigInteger support for Perl =head1 SYNOPSIS use bignt; $x = 2 + 4.5,"\n"; # BigInt 6 - print 2 ** 512; # really is what you think it is + print 2 ** 512,"\n"; # really is what you think it is + print inf + 42,"\n"; # inf + print NaN * 7,"\n"; # NaN =head1 DESCRIPTION |