[Encode] UTF-7 Support
[p5sagit/p5-mst-13.2.git] / lib / bigint.pm
index 900fe18..fa59d3b 100644 (file)
@@ -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