X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fbignum.pm;h=79fb685c0b68b8027a1c181e31bb55e7c9a6d4af;hb=05bab18efbb4de63339671e0a2623b4e3e26cb88;hp=db03d98c90583a175f32b2ad2fef2c3483c34408;hpb=b68b7ab1e328997a801e104fc190aa117fc75775;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/bignum.pm b/lib/bignum.pm index db03d98..79fb685 100644 --- a/lib/bignum.pm +++ b/lib/bignum.pm @@ -1,7 +1,7 @@ package bignum; require 5.005; -$VERSION = '0.16'; +$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 should not be neccessary, anyway. +transparent way of bignum C should not be necessary, anyway. Since Math::BigInt and BigFloat also overload the normal math operations, the following line will still work: @@ -363,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 the original and the copy beeing destroyed: +B the original and the copy being destroyed: $x = 9; $y = $x; print $x->badd(1), " ", $y,"\n"; # prints 10 10 @@ -386,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 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 properly. =item upgrade()