This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix broken MM_Win32.t tests following 27590
[perl5.git] / lib / bignum.pm
index 1902d58..79fb685 100644 (file)
@@ -1,7 +1,7 @@
 package bignum;
 require 5.005;
 
-$VERSION = '0.15';
+$VERSION = '0.17';
 use Exporter;
 @EXPORT_OK     = qw( ); 
 @EXPORT        = qw( inf NaN ); 
@@ -63,7 +63,7 @@ sub import
   my $self = shift;
 
   # some defaults
-  my $lib = 'Calc';
+  my $lib = '';
   my $upgrade = 'Math::BigFloat';
   my $downgrade = 'Math::BigInt';
 
@@ -140,9 +140,10 @@ sub import
       }
     require Math::BigInt if $_lite == 0;       # not already loaded?
     $class = 'Math::BigInt';                   # regardless of MBIL or not
-    } 
+    }
+  push @import, 'lib' => $lib if $lib ne ''; 
   # Math::BigInt::Trace or plain Math::BigInt
-  $class->import(@import, upgrade => $upgrade, lib => $lib);
+  $class->import(@import, upgrade => $upgrade);
 
   if ($trace)
     {
@@ -217,13 +218,13 @@ You can see this with the following:
 
 Don't worry if it says Math::BigInt::Lite, bignum and friends will use Lite
 if it is installed since it is faster for some operations. It will be
-automatically upgraded to BigInt whenever neccessary:
+automatically upgraded to BigInt whenever necessary:
 
         perl -Mbignum -le 'print ref(2**255)'
 
 This also means it is a bad idea to check for some specific package, since
 the actual contents of $x might be something unexpected. Due to the
-transparent way of bignum C<ref()> should not be neccessary, anyway.
+transparent way of bignum C<ref()> should not be necessary, anyway.
 
 Since Math::BigInt and BigFloat also overload the normal math operations,
 the following line will still work:
@@ -291,7 +292,7 @@ overloading of '..' is not yet possible in Perl (as of v5.8.0):
 
         perl -Mbignum -le 'for (1..2) { print ref($_); }'
 
-=head2 OPTIONS
+=head2 Options
 
 bignum recognizes some options that can be passed while loading it via use.
 The options can (currently) be either a single letter form, or the long form.
@@ -333,9 +334,9 @@ line. This will be hopefully fixed soon ;)
 
 This prints out the name and version of all modules used and then exits.
 
-       perl -Mbignum=v -e ''
+       perl -Mbignum=v
 
-=head2 METHODS
+=head2 Methods
 
 Beside import() and AUTOLOAD() there are only a few other methods.
 
@@ -344,7 +345,7 @@ the BigInt or BigFloat API. It is wise to use only the bxxx() notation, and not
 the fxxx() notation, though. This makes it possible that the underlying object
 might morph into a different class than BigFloat.
 
-=head2 CAVEAT
+=head2 Caveat
 
 But a warning is in order. When using the following to make a copy of a number,
 only a shallow copy will be made.
@@ -352,6 +353,10 @@ only a shallow copy will be made.
         $x = 9; $y = $x;
         $x = $y = 7;
 
+If you want to make a real copy, use the following:
+
+        $y = $x->copy();
+
 Using the copy or the original with overloaded math is okay, e.g. the
 following work:
 
@@ -359,7 +364,7 @@ following work:
         print $x + 1, " ", $y,"\n";     # prints 10 9
 
 but calling any method that modifies the number directly will result in
-B<both> the original and the copy beeing destroyed:
+B<both> the original and the copy being destroyed:
 
         $x = 9; $y = $x;
         print $x->badd(1), " ", $y,"\n";        # prints 10 10
@@ -382,12 +387,12 @@ well as the documentation in BigInt for further details.
 
 =item inf()
 
-A shortcut to return Math::BigInt->binf(). Usefull because Perl does not always
+A shortcut to return Math::BigInt->binf(). Useful because Perl does not always
 handle bareword C<inf> properly.
 
 =item NaN()
 
-A shortcut to return Math::BigInt->bnan(). Usefull because Perl does not always
+A shortcut to return Math::BigInt->bnan(). Useful because Perl does not always
 handle bareword C<NaN> properly.
 
 =item upgrade()