| Store | Cart

[perl #125939] [PATCH] Reformat code in .pm files in bignum distribution.

From: (Peter J. Acklam) (via RT) <perl...@perl.org>
Sat, 29 Aug 2015 02:45:05 -0700
# New Ticket Created by  (Peter J. Acklam) 
# Please include the string:  [perl #125939]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=125939 >


Apart from the incremented version number, all changes are pure code formatting changes -- indentation, lining things up vertically etc. There are no changes to the running code.
>From 7348c3a95a8261783a32dd1efa0c63a52f805aa0 Mon Sep 17 00:00:00 2001
From: Peter John Acklam <pjac...@online.no>
Date: Fri, 28 Aug 2015 16:37:32 +0200
Subject: [PATCH] Reformat code in .pm files in bignum distribution.

* Reformat code to make it more readable. The code should adhere to the
  guidelines in the 'perlstyle' manpage. All changes are in the amount
  of whitespace, e.g., all TAB characters are replaced by spaces. There
  are no changes in the way the code runs.

* Increment version number to 0.40.
---
 dist/bignum/lib/Math/BigFloat/Trace.pm |  53 ++-
 dist/bignum/lib/Math/BigInt/Trace.pm   |  44 +--
 dist/bignum/lib/bigint.pm              | 634 ++++++++++++++++-----------------
 dist/bignum/lib/bignum.pm              | 450 +++++++++++------------
 dist/bignum/lib/bigrat.pm              | 415 ++++++++++-----------
 5 files changed, 792 insertions(+), 804 deletions(-)

diff --git a/dist/bignum/lib/Math/BigFloat/Trace.pm b/dist/bignum/lib/Math/BigFloat/Trace.pm
index 203e051..6eee9fa 100644
--- a/dist/bignum/lib/Math/BigFloat/Trace.pm
+++ b/dist/bignum/lib/Math/BigFloat/Trace.pm
@@ -12,47 +12,46 @@ use vars qw($VERSION @ISA $PACKAGE @EXPORT_OK
 
 @ISA = qw(Exporter Math::BigFloat);
 
-$VERSION = '0.36';
+$VERSION = '0.40';
 
-use overload;	# inherit overload from BigFloat
+use overload;                   # inherit overload from BigFloat
 
 # Globals
 $accuracy = $precision = undef;
 $round_mode = 'even';
 $div_scale = 40;
 
-sub new
-{
-        my $proto  = shift;
-        my $class  = ref($proto) || $proto;
+sub new {
+    my $proto = shift;
+    my $class = ref($proto) || $proto;
 
-        my $value       = shift;
-	my $a = $accuracy; $a = $_[0] if defined $_[0];
-	my $p = $precision; $p = $_[1] if defined $_[1];
-        my $self = Math::BigFloat->new($value,$a,$p,$round_mode);
+    my $value = shift;
+    my $a = $accuracy;
+    $a = $_[0] if defined $_[0];
+    my $p = $precision;
+    $p = $_[1] if defined $_[1];
+    my $self = Math::BigFloat->new($value, $a, $p, $round_mode);
 
-#	remember, downgrading may return a BigInt, so don't meddle with class	
-#	bless $self,$class;
+    # remember, downgrading may return a BigInt, so don't meddle with class
+    # bless $self, $class;
 
-	print "MBF new '$value' => '$self' (",ref($self),")";
-        return $self;
+    print "MBF new '$value' => '$self' (", ref($self), ")";
+    return $self;
 }
 
-sub import
-  {
-  print "MBF import ",join(' ',@_);
-  my $self = shift;
+sub import {
+    print "MBF import ", join(' ', @_);
+    my $self = shift;
 
-  # we catch the constants, the rest goes go BigFloat
-  my @a = ();
-  foreach (@_)
-    {
-    push @a, $_ if $_ ne ':constant';
+    # we catch the constants, the rest goes go BigFloat
+    my @a = ();
+    foreach (@_) {
+        push @a, $_ if $_ ne ':constant';
     }
-  overload::constant float => sub { $self->new(shift); }; 
+    overload::constant float => sub { $self->new(shift); };
 
-  Math::BigFloat->import(@a);		# need it for subclasses
-#  $self->export_to_level(1,$self,@_);		# need this ?
-  }
+    Math::BigFloat->import(@a);                 # need it for subclasses
+#    $self->export_to_level(1,$self,@_);         # need this ?
+}
 
 1;
diff --git a/dist/bignum/lib/Math/BigInt/Trace.pm b/dist/bignum/lib/Math/BigInt/Trace.pm
index 79fc097..6cab46c 100644
--- a/dist/bignum/lib/Math/BigInt/Trace.pm
+++ b/dist/bignum/lib/Math/BigInt/Trace.pm
@@ -12,36 +12,36 @@ use vars qw($VERSION @ISA $PACKAGE @EXPORT_OK
 
 @ISA = qw(Exporter Math::BigInt);
 
-$VERSION = '0.36';
+$VERSION = '0.40';
 
-use overload;	# inherit overload from BigInt
+use overload;                   # inherit overload from BigInt
 
 # Globals
 $accuracy = $precision = undef;
 $round_mode = 'even';
 $div_scale = 40;
 
-sub new
-{
-        my $proto  = shift;
-        my $class  = ref($proto) || $proto;
-
-        my $value       = shift;
-	my $a = $accuracy; $a = $_[0] if defined $_[0];
-	my $p = $precision; $p = $_[1] if defined $_[1];
-        my $self = Math::BigInt->new($value,$a,$p,$round_mode);
-	bless $self,$class;
-	print "MBI new '$value' => '$self' (",ref($self),")";
-        return $self;
+sub new {
+    my $proto  = shift;
+    my $class  = ref($proto) || $proto;
+
+    my $value = shift;
+    my $a = $accuracy;
+    $a = $_[0] if defined $_[0];
+    my $p = $precision;
+    $p = $_[1] if defined $_[1];
+    my $self = Math::BigInt->new($value, $a, $p, $round_mode);
+    bless $self, $class;
+    print "MBI new '$value' => '$self' (", ref($self), ")";
+    return $self;
 }
 
-sub import
-  {
-  print "MBI import ",join(' ',@_);
-  my $self = shift;
-  Math::BigInt::import($self,@_);		# need it for subclasses
-#  $self->export_to_level(1,$self,@_);		# need this ?
-  @_ = ();
-  }
+sub import {
+    print "MBI import ", join(' ', @_);
+    my $self = shift;
+    Math::BigInt::import($self, @_);            # need it for subclasses
+#    $self->export_to_level(1, $self, @_);       # need this ?
+    @_ = ();
+}
 
 1;
diff --git a/dist/bignum/lib/bigint.pm b/dist/bignum/lib/bigint.pm
index 3bcf15a..e6481bd 100644
--- a/dist/bignum/lib/bigint.pm
+++ b/dist/bignum/lib/bigint.pm
@@ -1,121 +1,109 @@
 package bigint;
 use 5.006;
 
-$VERSION = '0.39';
+$VERSION = '0.40';
 use Exporter;
-...@ISA		= qw( Exporter );
-...@EXPORT_OK	= qw( PI e bpi bexp hex oct );
-...@EXPORT		= qw( inf NaN );
+...@ISA            = qw( Exporter );
+...@EXPORT_OK      = qw( PI e bpi bexp hex oct );
+...@EXPORT         = qw( inf NaN );
 
 use strict;
 use overload;
 
-############################################################################## 
+##############################################################################
 
 # These are all alike, and thus faked by AUTOLOAD
 
 my @faked = qw/round_mode accuracy precision div_scale/;
-use vars qw/$VERSION $AUTOLOAD $_lite/;		# _lite for testsuite
-
-sub AUTOLOAD
-  {
-  my $name = $AUTOLOAD;
-
-  $name =~ s/.*:://;    # split package
-  no strict 'refs';
-  foreach my $n (@faked)
-    {
-    if ($n eq $name)
-      {
-      *{"bigint::$name"} = sub 
-        {
-        my $self = shift;
-        no strict 'refs';
-        if (defined $_[0])
-          {
-          return Math::BigInt->$name($_[0]);
-          }
-        return Math::BigInt->$name();
-        };
-      return &$name;
-      }
+use vars qw/$VERSION $AUTOLOAD $_lite/;         # _lite for testsuite
+
+sub AUTOLOAD {
+    my $name = $AUTOLOAD;
+
+    $name =~ s/.*:://;          # split package
+    no strict 'refs';
+    foreach my $n (@faked) {
+        if ($n eq $name) {
+            *{"bigint::$name"} =
+              sub {
+                  my $self = shift;
+                  no strict 'refs';
+                  if (defined $_[0]) {
+                      return Math::BigInt->$name($_[0]);
+                  }
+                  return Math::BigInt->$name();
+              };
+            return &$name;
+        }
     }
- 
-  # delayed load of Carp and avoid recursion
-  require Carp;
-  Carp::croak ("Can't call bigint\-\>$name, not a valid method");
-  }
 
-sub upgrade
-  {
-  $Math::BigInt::upgrade;
-  }
+    # delayed load of Carp and avoid recursion
+    require Carp;
+    Carp::croak ("Can't call bigint\-\>$name, not a valid method");
+}
 
-sub _binary_constant
-  {
-  # this takes a binary/hexadecimal/octal constant string and returns it
-  # as string suitable for new. Basically it converts octal to decimal, and
-  # passes every thing else unmodified back.
-  my $string = shift;
+sub upgrade {
+    $Math::BigInt::upgrade;
+}
 
-  return Math::BigInt->new($string) if $string =~ /^0[bx]/;
+sub _binary_constant {
+    # this takes a binary/hexadecimal/octal constant string and returns it
+    # as string suitable for new. Basically it converts octal to decimal, and
+    # passes every thing else unmodified back.
+    my $string = shift;
 
-  # so it must be an octal constant
-  Math::BigInt->from_oct($string);
-  }
+    return Math::BigInt->new($string) if $string =~ /^0[bx]/;
 
-sub _float_constant
-  {
-  # this takes a floating point constant string and returns it truncated to
-  # integer. For instance, '4.5' => '4', '1.234e2' => '123' etc
-  my $float = shift;
-
-  # some simple cases first
-  return $float if ($float =~ /^[+-]?[0-9]+$/);		# '+123','-1','0' etc
-  return $float 
-    if ($float =~ /^[+-]?[0-9]+\.?[eE]\+?[0-9]+$/);	# 123e2, 123.e+2
-  return '0' if ($float =~ /^[+-]?[0]*\.[0-9]+$/);	# .2, 0.2, -.1
-  if ($float =~ /^[+-]?[0-9]+\.[0-9]*$/)		# 1., 1.23, -1.2 etc
-    {
-    $float =~ s/\..*//;
-    return $float;
+    # so it must be an octal constant
+    Math::BigInt->from_oct($string);
+}
+
+sub _float_constant {
+    # this takes a floating point constant string and returns it truncated to
+    # integer. For instance, '4.5' => '4', '1.234e2' => '123' etc
+    my $float = shift;
+
+    # some simple cases first
+    return $float if ($float =~ /^[+-]?[0-9]+$/);       # '+123','-1','0' etc
+    return $float
+      if ($float =~ /^[+-]?[0-9]+\.?[eE]\+?[0-9]+$/);   # 123e2, 123.e+2
+    return '0' if ($float =~ /^[+-]?[0]*\.[0-9]+$/);    # .2, 0.2, -.1
+    if ($float =~ /^[+-]?[0-9]+\.[0-9]*$/) {            # 1., 1.23, -1.2 etc
+        $float =~ s/\..*//;
+        return $float;
     }
-  my ($mis,$miv,$mfv,$es,$ev) = Math::BigInt::_split($float);
-  return $float if !defined $mis; 	# doesn't look like a number to me
-  my $ec = int($$ev);
-  my $sign = $$mis; $sign = '' if $sign eq '+';
-  if ($$es eq '-')
-    {
-    # ignore fraction part entirely
-    if ($ec >= length($$miv))			# 123.23E-4
-      {
-      return '0';
-      }
-    return $sign . substr ($$miv,0,length($$miv)-$ec);	# 1234.45E-2 = 12
+    my ($mis, $miv, $mfv, $es, $ev) = Math::BigInt::_split($float);
+    return $float if !defined $mis;       # doesn't look like a number to me
+    my $ec = int($$ev);
+    my $sign = $$mis;
+    $sign = '' if $sign eq '+';
+    if ($$es eq '-') {
+        # ignore fraction part entirely
+        if ($ec >= length($$miv)) {                     # 123.23E-4
+            return '0';
+        }
+        return $sign . substr($$miv, 0, length($$miv) - $ec); # 1234.45E-2 = 12
     }
-  # xE+y
-  if ($ec >= length($$mfv))
-    {
-    $ec -= length($$mfv);			
-    return $sign.$$miv.$$mfv if $ec == 0;	# 123.45E+2 => 12345
-    return $sign.$$miv.$$mfv.'E'.$ec; 		# 123.45e+3 => 12345e1
+    # xE+y
+    if ($ec >= length($$mfv)) {
+        $ec -= length($$mfv);
+        return $sign.$$miv.$$mfv if $ec == 0;           # 123.45E+2 => 12345
+        return $sign.$$miv.$$mfv.'E'.$ec;               # 123.45e+3 => 12345e1
     }
-  $mfv = substr($$mfv,0,$ec);
-  $sign.$$miv.$mfv; 				# 123.45e+1 => 1234
-  }
+    $mfv = substr($$mfv, 0, $ec);
+    $sign.$$miv.$mfv;                                   # 123.45e+1 => 1234
+}
 
-sub unimport
-  {
-  $^H{bigint} = undef;					# no longer in effect
-  overload::remove_constant('binary','','float','','integer');
-  }
+sub unimport {
+    $^H{bigint} = undef;                                # no longer in effect
+    overload::remove_constant('binary', '', 'float', '', 'integer');
+}
 
-sub in_effect
-  {
-  my $level = shift || 0;
-  my $hinthash = (caller($level))[10];
-  $hinthash->{bigint};
-  }
+sub in_effect {
+    my $level = shift || 0;
+    my $hinthash = (caller($level))[10];
+    $hinthash->{bigint};
+}
 
 #############################################################################
 # the following two routines are for "use bigint qw/hex oct/;":
@@ -125,21 +113,19 @@ use constant LEXICAL => $] > 5.009004;
 {
     my $proto = LEXICAL ? '_' : ';$';
     eval '
-sub hex(' . $proto . ')' . <<'.';
-  {
-  my $i = @_ ? $_[0] : $_;
-  $i = '0x'.$i unless $i =~ /^0x/;
-  Math::BigInt->new($i);
-  }
+sub hex(' . $proto . ') {' . <<'.';
+    my $i = @_ ? $_[0] : $_;
+    $i = '0x'.$i unless $i =~ /^0x/;
+    Math::BigInt->new($i);
+}
 .
     eval '
-sub oct(' . $proto . ')' . <<'.';
-  {
-  my $i = @_ ? $_[0] : $_;
-  # oct() should never fall back to decimal
-  return Math::BigInt->from_oct($i) if $i =~ s/^(?=0[0-9]|[1-9])/0/;
-  Math::BigInt->new($i);
-  }
+sub oct(' . $proto . ') {' . <<'.';
+    my $i = @_ ? $_[0] : $_;
+    # oct() should never fall back to decimal
+    return Math::BigInt->from_oct($i) if $i =~ s/^(?=0[0-9]|[1-9])/0/;
+    Math::BigInt->new($i);
+}
 .
 }
 
@@ -149,145 +135,143 @@ sub oct(' . $proto . ')' . <<'.';
 my ($prev_oct, $prev_hex, $overridden);
 
 if (LEXICAL) { eval <<'.' }
-sub _hex(_)
-  {
-  my $hh = (caller 0)[10];
-  return $prev_hex ? &$prev_hex($_[0]) : CORE::hex($_[0])
-    unless $$hh{bigint}||$$hh{bignum}||$$hh{bigrat};
-  my $i = $_[0];
-  $i = '0x'.$i unless $i =~ /^0x/;
-  Math::BigInt->new($i);
-  }
+sub _hex(_) {
+    my $hh = (caller 0)[10];
+    return $prev_hex ? &$prev_hex($_[0]) : CORE::hex($_[0])
+      unless $$hh{bigint}||$$hh{bignum}||$$hh{bigrat};
+    my $i = $_[0];
+    $i = '0x'.$i unless $i =~ /^0x/;
+    Math::BigInt->new($i);
+}
 
-sub _oct(_)
-  {
-  my $hh = (caller 0)[10];
-  return $prev_oct ? &$prev_oct($_[0]) : CORE::oct($_[0])
-    unless $$hh{bigint}||$$hh{bignum}||$$hh{bigrat};
-  my $i = $_[0];
-  # oct() should never fall back to decimal
-  return Math::BigInt->from_oct($i) if $i =~ s/^(?=0[0-9]|[1-9])/0/;
-  Math::BigInt->new($i);
-  }
+sub _oct(_) {
+    my $hh = (caller 0)[10];
+    return $prev_oct ? &$prev_oct($_[0]) : CORE::oct($_[0])
+      unless $$hh{bigint}||$$hh{bignum}||$$hh{bigrat};
+    my $i = $_[0];
+    # oct() should never fall back to decimal
+    return Math::BigInt->from_oct($i) if $i =~ s/^(?=0[0-9]|[1-9])/0/;
+    Math::BigInt->new($i);
+}
 .
 
-sub _override
-  {
-  return if $overridden;
-  $prev_oct = *CORE::GLOBAL::oct{CODE};
-  $prev_hex = *CORE::GLOBAL::hex{CODE};
-  no warnings 'redefine';
-  *CORE::GLOBAL::oct = \&_oct;
-  *CORE::GLOBAL::hex = \&_hex;
-  $overridden++;
-  }
+sub _override {
+    return if $overridden;
+    $prev_oct = *CORE::GLOBAL::oct{CODE};
+    $prev_hex = *CORE::GLOBAL::hex{CODE};
+    no warnings 'redefine';
+    *CORE::GLOBAL::oct = \&_oct;
+    *CORE::GLOBAL::hex = \&_hex;
+    $overridden++;
+}
 
-sub import 
-  {
-  my $self = shift;
+sub import {
+    my $self = shift;
 
-  $^H{bigint} = 1;					# we are in effect
+    $^H{bigint} = 1;                            # we are in effect
 
-  # for newer Perls always override hex() and oct() with a lexical version:
-  if (LEXICAL)
-    {
-    _override();
+    # for newer Perls always override hex() and oct() with a lexical version:
+    if (LEXICAL) {
+        _override();
     }
-  # some defaults
-  my $lib = ''; my $lib_kind = 'try';
-
-  my @import = ( ':constant' );				# drive it w/ constant
-  my @a = @_; my $l = scalar @_; my $j = 0;
-  my ($ver,$trace);					# version? trace?
-  my ($a,$p);						# accuracy, precision
-  for ( my $i = 0; $i < $l ; $i++,$j++ )
-    {
-    if ($_[$i] =~ /^(l|lib|try|only)$/)
-      {
-      # this causes a different low lib to take care...
-      $lib_kind = $1; $lib_kind = 'lib' if $lib_kind eq 'l';
-      $lib = $_[$i+1] || '';
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(a|accuracy)$/)
-      {
-      $a = $_[$i+1];
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(p|precision)$/)
-      {
-      $p = $_[$i+1];
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(v|version)$/)
-      {
-      $ver = 1;
-      splice @a, $j, 1; $j --;
-      }
-    elsif ($_[$i] =~ /^(t|trace)$/)
-      {
-      $trace = 1;
-      splice @a, $j, 1; $j --;
-      }
-    elsif ($_[$i] !~ /^(PI|e|bpi|bexp|hex|oct)\z/)
-      {
-      die ("unknown option $_[$i]");
-      }
-    }
-  my $class;
-  $_lite = 0;					# using M::BI::L ?
-  if ($trace)
-    {
-    require Math::BigInt::Trace; $class = 'Math::BigInt::Trace';
+    # some defaults
+    my $lib = '';
+    my $lib_kind = 'try';
+
+    my @import = (':constant');                 # drive it w/ constant
+    my @a = @_;
+    my $l = scalar @_;
+    my $j = 0;
+    my ($ver, $trace);                          # version? trace?
+    my ($a, $p);                                # accuracy, precision
+    for (my $i = 0; $i < $l; $i++, $j++) {
+        if ($_[$i] =~ /^(l|lib|try|only)$/) {
+            # this causes a different low lib to take care...
+            $lib_kind = $1;
+            $lib_kind = 'lib' if $lib_kind eq 'l';
+            $lib = $_[$i + 1] || '';
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        } elsif ($_[$i] =~ /^(a|accuracy)$/) {
+            $a = $_[$i + 1];
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        } elsif ($_[$i] =~ /^(p|precision)$/) {
+            $p = $_[$i + 1];
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        } elsif ($_[$i] =~ /^(v|version)$/) {
+            $ver = 1;
+            splice @a, $j, 1;
+            $j--;
+        } elsif ($_[$i] =~ /^(t|trace)$/) {
+            $trace = 1;
+            splice @a, $j, 1;
+            $j--;
+        } elsif ($_[$i] !~ /^(PI|e|bpi|bexp|hex|oct)\z/) {
+            die ("unknown option $_[$i]");
+        }
     }
-  else
-    {
-    # see if we can find Math::BigInt::Lite
-    if (!defined $a && !defined $p)		# rounding won't work to well
-      {
-      if (eval { require Math::BigInt::Lite; 1 })
-        {
-        @import = ( );				# :constant in Lite, not MBI
-        Math::BigInt::Lite->import( ':constant' );
-        $_lite= 1;				# signal okay
+    my $class;
+    $_lite = 0;                                 # using M::BI::L ?
+    if ($trace) {
+        require Math::BigInt::Trace;
+        $class = 'Math::BigInt::Trace';
+    } else {
+        # see if we can find Math::BigInt::Lite
+        if (!defined $a && !defined $p) {       # rounding won't work to well
+            if (eval { require Math::BigInt::Lite; 1 }) {
+                @import = ();                   # :constant in Lite, not MBI
+                Math::BigInt::Lite->import(':constant');
+                $_lite = 1;                     # signal okay
+            }
         }
-      }
-    require Math::BigInt if $_lite == 0;	# not already loaded?
-    $class = 'Math::BigInt';			# regardless of MBIL or not
+        require Math::BigInt if $_lite == 0;    # not already loaded?
+        $class = 'Math::BigInt';                # regardless of MBIL or not
     }
-  push @import, $lib_kind => $lib if $lib ne '';
-  # Math::BigInt::Trace or plain Math::BigInt
-  $class->import(@import);
-
-  bigint->accuracy($a) if defined $a;
-  bigint->precision($p) if defined $p;
-  if ($ver)
-    {
-    print "bigint\t\t\t v$VERSION\n";
-    print "Math::BigInt::Lite\t v$Math::BigInt::Lite::VERSION\n" if $_lite;
-    print "Math::BigInt\t\t v$Math::BigInt::VERSION";
-    my $config = Math::BigInt->config();
-    print " lib => $config->{lib} v$config->{lib_version}\n";
-    exit;
+    push @import, $lib_kind => $lib if $lib ne '';
+    # Math::BigInt::Trace or plain Math::BigInt
+    $class->import(@import);
+
+    bigint->accuracy($a)  if defined $a;
+    bigint->precision($p) if defined $p;
+    if ($ver) {
+        print "bigint\t\t\t v$VERSION\n";
+        print "Math::BigInt::Lite\t v$Math::BigInt::Lite::VERSION\n" if $_lite;
+        print "Math::BigInt\t\t v$Math::BigInt::VERSION";
+        my $config = Math::BigInt->config();
+        print " lib => $config->{lib} v$config->{lib_version}\n";
+        exit;
     }
-  # 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( _float_constant(shift) ); };
-  # Take care of octal/hexadecimal constants
-  overload::constant binary => sub { _binary_constant(shift) };
-
-  # if another big* was already loaded:
-  my ($package) = caller();
-
-  no strict 'refs';
-  if (!defined *{"${package}::inf"})
-    {
-    $self->export_to_level(1,$self,@a);           # export inf and NaN, e and PI
+    # 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(_float_constant(shift));
+        };
+    # Take care of octal/hexadecimal constants
+    overload::constant binary =>
+        sub {
+            _binary_constant(shift);
+        };
+
+    # if another big* was already loaded:
+    my ($package) = caller();
+
+    no strict 'refs';
+    if (!defined *{"${package}::inf"}) {
+        $self->export_to_level(1, $self, @a);   # export inf and NaN, e and PI
     }
-  }
+}
 
 sub inf () { Math::BigInt::binf(); }
 sub NaN () { Math::BigInt::bnan(); }
@@ -295,7 +279,10 @@ sub NaN () { Math::BigInt::bnan(); }
 sub PI () { Math::BigInt->new(3); }
 sub e () { Math::BigInt->new(2); }
 sub bpi ($) { Math::BigInt->new(3); }
-sub bexp ($$) { my $x = Math::BigInt->new($_[0]); $x->bexp($_[1]); }
+sub bexp ($$) {
+    my $x = Math::BigInt->new($_[0]);
+    $x->bexp($_[1]);
+}
 
 1;
 
@@ -309,15 +296,15 @@ bigint - Transparent BigInteger support for Perl
 
   use bigint;
 
-  $x = 2 + 4.5,"\n";			# BigInt 6
-  print 2 ** 512,"\n";			# really is what you think it is
-  print inf + 42,"\n";			# inf
-  print NaN * 7,"\n";			# NaN
-  print hex("0x1234567890123490"),"\n";	# Perl v5.10.0 or later
+  $x = 2 + 4.5,"\n";                    # BigInt 6
+  print 2 ** 512,"\n";                  # really is what you think it is
+  print inf + 42,"\n";                  # inf
+  print NaN * 7,"\n";                   # NaN
+  print hex("0x1234567890123490"),"\n"; # Perl v5.10.0 or later
 
   {
     no bigint;
-    print 2 ** 256,"\n";		# a normal Perl scalar now
+    print 2 ** 256,"\n";                # a normal Perl scalar now
   }
 
   # Import into current package:
@@ -342,32 +329,32 @@ There is one small difference between C<use integer> and C<use bigint>: the
 former will not affect assignments to variables and the return value of
 some functions. C<bigint> truncates these results to integer too:
 
-	# perl -Minteger -wle 'print 3.2'
-	3.2
-	# perl -Minteger -wle 'print 3.2 + 0'
-	3
-	# perl -Mbigint -wle 'print 3.2'
-	3
-	# perl -Mbigint -wle 'print 3.2 + 0'
-	3
-
-	# perl -Mbigint -wle 'print exp(1) + 0'
-	2
-	# perl -Mbigint -wle 'print exp(1)'
-	2
-	# perl -Minteger -wle 'print exp(1)'
-	2.71828182845905
-	# perl -Minteger -wle 'print exp(1) + 0'
-	2
+        # perl -Minteger -wle 'print 3.2'
+        3.2
+        # perl -Minteger -wle 'print 3.2 + 0'
+        3
+        # perl -Mbigint -wle 'print 3.2'
+        3
+        # perl -Mbigint -wle 'print 3.2 + 0'
+        3
+
+        # perl -Mbigint -wle 'print exp(1) + 0'
+        2
+        # perl -Mbigint -wle 'print exp(1)'
+        2
+        # perl -Minteger -wle 'print exp(1)'
+        2.71828182845905
+        # perl -Minteger -wle 'print exp(1) + 0'
+        2
 
 In practice this makes seldom a difference as B<parts and results> of
 expressions will be truncated anyway, but this can, for instance, affect the
 return value of subroutines:
 
-    sub three_integer { use integer; return 3.2; } 
+    sub three_integer { use integer; return 3.2; }
     sub three_bigint { use bigint; return 3.2; }
 
-    print three_integer(), " ", three_bigint(),"\n";	# prints "3.2 3"
+    print three_integer(), " ", three_bigint(),"\n";    # prints "3.2 3"
 
 =head2 Options
 
@@ -382,7 +369,7 @@ The following options exist:
 This sets the accuracy for all math operations. The argument must be greater
 than or equal to zero. See Math::BigInt's bround() function for details.
 
-	perl -Mbigint=a,2 -le 'print 12345+1'
+        perl -Mbigint=a,2 -le 'print 12345+1'
 
 Note that setting precision and accuracy at the same time is not possible.
 
@@ -396,7 +383,7 @@ integer and are ignore like negative values.
 
 See Math::BigInt's bfround() function for details.
 
-	perl -Mbignum=p,5 -le 'print 123456789+123'
+        perl -Mbignum=p,5 -le 'print 123456789+123'
 
 Note that setting precision and accuracy at the same time is not possible.
 
@@ -423,14 +410,14 @@ overridden in the current scope whenever the bigint pragma is active.
 
 Load a different math lib, see L<Math Library>.
 
-	perl -Mbigint=lib,GMP -e 'print 2 ** 512'
-	perl -Mbigint=try,GMP -e 'print 2 ** 512'
-	perl -Mbigint=only,GMP -e 'print 2 ** 512'
+        perl -Mbigint=lib,GMP -e 'print 2 ** 512'
+        perl -Mbigint=try,GMP -e 'print 2 ** 512'
+        perl -Mbigint=only,GMP -e 'print 2 ** 512'
 
 Currently there is no way to specify more than one library on the command
 line. This means the following does not work:
 
-	perl -Mbignum=l,GMP,Pari -e 'print 2 ** 512'
+        perl -Mbignum=l,GMP,Pari -e 'print 2 ** 512'
 
 This will be hopefully fixed soon ;)
 
@@ -438,7 +425,7 @@ This will be hopefully fixed soon ;)
 
 This prints out the name and version of all modules used and then exits.
 
-	perl -Mbigint=v
+        perl -Mbigint=v
 
 =back
 
@@ -447,16 +434,16 @@ This prints out the name and version of all modules used and then exits.
 Math with the numbers is done (by default) by a module called
 Math::BigInt::Calc. This is equivalent to saying:
 
-	use bigint lib => 'Calc';
+        use bigint lib => 'Calc';
 
 You can change this by using:
 
-	use bignum lib => 'GMP';
+        use bignum lib => 'GMP';
 
 The following would first try to find Math::BigInt::Foo, then
 Math::BigInt::Bar, and when this also fails, revert to Math::BigInt::Calc:
 
-	use bigint lib => 'Foo,Math::BigInt::Bar';
+        use bigint lib => 'Foo,Math::BigInt::Bar';
 
 Using C<lib> warns if none of the specified libraries can be found and
 L<Math::BigInt> did fall back to one of the default libraries.
@@ -496,36 +483,36 @@ minus infinity. You will get '+inf' when dividing a positive number by 0, and
 
 Since all numbers are now objects, you can use all functions that are part of
 the BigInt API. You can only use the bxxx() notation, and not the fxxx()
-notation, though. 
+notation, though.
 
 But a warning is in order. When using the following to make a copy of a number,
 only a shallow copy will be made.
 
-	$x = 9; $y = $x;
-	$x = $y = 7;
+        $x = 9; $y = $x;
+        $x = $y = 7;
 
 Using the copy or the original with overloaded math is okay, e.g. the
 following work:
 
-	$x = 9; $y = $x;
-	print $x + 1, " ", $y,"\n";	# prints 10 9
+        $x = 9; $y = $x;
+        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 being destroyed:
 
-	$x = 9; $y = $x;
-	print $x->badd(1), " ", $y,"\n";	# prints 10 10
+        $x = 9; $y = $x;
+        print $x->badd(1), " ", $y,"\n";        # prints 10 10
 
-	$x = 9; $y = $x;
-	print $x->binc(1), " ", $y,"\n";	# prints 10 10
+        $x = 9; $y = $x;
+        print $x->binc(1), " ", $y,"\n";        # prints 10 10
 
-	$x = 9; $y = $x;
-	print $x->bmul(2), " ", $y,"\n";	# prints 18 18
+        $x = 9; $y = $x;
+        print $x->bmul(2), " ", $y,"\n";        # prints 18 18
 
 Using methods that do not modify, but test that the contents works:
 
-	$x = 9; $y = $x;
-	$z = 9 if $x->is_zero();		# works fine
+        $x = 9; $y = $x;
+        $z = 9 if $x->is_zero();                # works fine
 
 See the documentation about the copy constructor and C<=> in overload, as
 well as the documentation in BigInt for further details.
@@ -546,21 +533,21 @@ handle bareword C<NaN> properly.
 
 =item e
 
-	# perl -Mbigint=e -wle 'print e'
+        # perl -Mbigint=e -wle 'print e'
 
 Returns Euler's number C<e>, aka exp(1). Note that under bigint, this is
 truncated to an integer, and hence simple '2'.
 
 =item PI
 
-	# perl -Mbigint=PI -wle 'print PI'
+        # perl -Mbigint=PI -wle 'print PI'
 
 Returns PI. Note that under bigint, this is truncated to an integer, and hence
 simple '3'.
 
 =item bexp()
 
-	bexp($power,$accuracy);
+        bexp($power,$accuracy);
 
 Returns Euler's number C<e> raised to the appropriate power, to
 the wanted accuracy.
@@ -569,18 +556,18 @@ Note that under bigint, the result is truncated to an integer.
 
 Example:
 
-	# perl -Mbigint=bexp -wle 'print bexp(1,80)'
+        # perl -Mbigint=bexp -wle 'print bexp(1,80)'
 
 =item bpi()
 
-	bpi($accuracy);
+        bpi($accuracy);
 
 Returns PI to the wanted accuracy. Note that under bigint, this is truncated
 to an integer, and hence simple '3'.
 
 Example:
 
-	# perl -Mbigint=bpi -wle 'print bpi(80)'
+        # perl -Mbigint=bpi -wle 'print bpi(80)'
 
 =item upgrade()
 
@@ -589,13 +576,13 @@ C<$Math::BigInt::upgrade>.
 
 =item in_effect()
 
-	use bigint;
+        use bigint;
 
-	print "in effect\n" if bigint::in_effect;	# true
-	{
-	  no bigint;
-	  print "in effect\n" if bigint::in_effect;	# false
-	}
+        print "in effect\n" if bigint::in_effect;       # true
+        {
+          no bigint;
+          print "in effect\n" if bigint::in_effect;     # false
+        }
 
 Returns true or false if C<bigint> is in effect in the current scope.
 
@@ -633,14 +620,13 @@ C<Math::BigInt> objects, use a literal number in the expression:
 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
-	  }
-	}
-
+        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()
 
@@ -654,22 +640,22 @@ will not happen unless you specifically ask for it with the two
 import tags "hex" and "oct" - and then it will be global and cannot be
 disabled inside a scope with "no bigint":
 
-	use bigint qw/hex oct/;
+        use bigint qw/hex oct/;
 
-	print hex("0x1234567890123456");
-	{
-		no bigint;
-		print hex("0x1234567890123456");
-	}
+        print hex("0x1234567890123456");
+        {
+                no bigint;
+                print hex("0x1234567890123456");
+        }
 
 The second call to hex() will warn about a non-portable constant.
 
 Compare this to:
 
-	use bigint;
+        use bigint;
 
-	# will warn only under Perl older than v5.9.4
-	print hex("0x1234567890123456");
+        # will warn only under Perl older than v5.9.4
+        print hex("0x1234567890123456");
 
 =back
 
@@ -681,23 +667,23 @@ the others to do the work.
 
 The following modules are currently used by bigint:
 
-	Math::BigInt::Lite	(for speed, and only if it is loadable)
-	Math::BigInt
+        Math::BigInt::Lite      (for speed, and only if it is loadable)
+        Math::BigInt
 
 =head1 EXAMPLES
 
 Some cool command line examples to impress the Python crowd ;) You might want
 to compare them to the results under -Mbignum or -Mbigrat:
 
-	perl -Mbigint -le 'print sqrt(33)'
-	perl -Mbigint -le 'print 2*255'
-	perl -Mbigint -le 'print 4.5+2*255'
-	perl -Mbigint -le 'print 3/7 + 5/7 + 8/3'
-	perl -Mbigint -le 'print 123->is_odd()'
-	perl -Mbigint -le 'print log(2)'
-	perl -Mbigint -le 'print 2 ** 0.5'
-	perl -Mbigint=a,65 -le 'print 2 ** 0.2'
-	perl -Mbignum=a,65,l,GMP -le 'print 7 ** 7777'
+        perl -Mbigint -le 'print sqrt(33)'
+        perl -Mbigint -le 'print 2*255'
+        perl -Mbigint -le 'print 4.5+2*255'
+        perl -Mbigint -le 'print 3/7 + 5/7 + 8/3'
+        perl -Mbigint -le 'print 123->is_odd()'
+        perl -Mbigint -le 'print log(2)'
+        perl -Mbigint -le 'print 2 ** 0.5'
+        perl -Mbigint=a,65 -le 'print 2 ** 0.2'
+        perl -Mbignum=a,65,l,GMP -le 'print 7 ** 7777'
 
 =head1 LICENSE
 
diff --git a/dist/bignum/lib/bignum.pm b/dist/bignum/lib/bignum.pm
index 67b9ede..61f2bca 100644
--- a/dist/bignum/lib/bignum.pm
+++ b/dist/bignum/lib/bignum.pm
@@ -1,215 +1,217 @@
 package bignum;
 use 5.006;
 
-$VERSION = '0.39';
+$VERSION = '0.40';
 use Exporter;
-...@ISA 		= qw( bigint );
-...@EXPORT_OK	= qw( PI e bexp bpi hex oct ); 
-...@EXPORT 	= qw( inf NaN ); 
+...@ISA            = qw( bigint );
+...@EXPORT_OK      = qw( PI e bexp bpi hex oct );
+...@EXPORT         = qw( inf NaN );
 
 use strict;
 use overload;
 use bigint ();
 
-############################################################################## 
+##############################################################################
 
-BEGIN 
-  {
-  *inf = \&bigint::inf;
-  *NaN = \&bigint::NaN;
-  *hex = \&bigint::hex;
-  *oct = \&bigint::oct;
-  }
+BEGIN {
+    *inf = \&bigint::inf;
+    *NaN = \&bigint::NaN;
+    *hex = \&bigint::hex;
+    *oct = \&bigint::oct;
+}
 
 # These are all alike, and thus faked by AUTOLOAD
 
 my @faked = qw/round_mode accuracy precision div_scale/;
-use vars qw/$VERSION $AUTOLOAD $_lite/;		# _lite for testsuite
-
-sub AUTOLOAD
-  {
-  my $name = $AUTOLOAD;
-
-  $name =~ s/.*:://;    # split package
-  no strict 'refs';
-  foreach my $n (@faked)
-    {
-    if ($n eq $name)
-      {
-      *{"bignum::$name"} = sub 
-        {
-        my $self = shift;
-        no strict 'refs';
-        if (defined $_[0])
-          {
-          Math::BigInt->$name($_[0]);
-          return Math::BigFloat->$name($_[0]);
-          }
-        return Math::BigInt->$name();
-        };
-      return &$name;
-      }
+use vars qw/$VERSION $AUTOLOAD $_lite/;         # _lite for testsuite
+
+sub AUTOLOAD {
+    my $name = $AUTOLOAD;
+
+    $name =~ s/.*:://;    # split package
+    no strict 'refs';
+    foreach my $n (@faked) {
+        if ($n eq $name) {
+            *{"bignum::$name"} =
+              sub {
+                  my $self = shift;
+                  no strict 'refs';
+                  if (defined $_[0]) {
+                      Math::BigInt->$name($_[0]);
+                      return Math::BigFloat->$name($_[0]);
+                  }
+                  return Math::BigInt->$name();
+              };
+            return &$name;
+        }
     }
- 
-  # delayed load of Carp and avoid recursion
-  require Carp;
-  Carp::croak ("Can't call bignum\-\>$name, not a valid method");
-  }
 
-sub unimport
-  {
-  $^H{bignum} = undef;					# no longer in effect
-  overload::remove_constant('binary','','float','','integer');
-  }
+    # delayed load of Carp and avoid recursion
+    require Carp;
+    Carp::croak ("Can't call bignum\-\>$name, not a valid method");
+}
 
-sub in_effect
-  {
-  my $level = shift || 0;
-  my $hinthash = (caller($level))[10];
-  $hinthash->{bignum};
-  }
+sub unimport {
+    $^H{bignum} = undef;                                # no longer in effect
+    overload::remove_constant('binary', '', 'float', '', 'integer');
+}
+
+sub in_effect {
+    my $level = shift || 0;
+    my $hinthash = (caller($level))[10];
+    $hinthash->{bignum};
+}
 
 #############################################################################
 
-sub import 
-  {
-  my $self = shift;
+sub import {
+    my $self = shift;
 
-  $^H{bignum} = 1;					# we are in effect
+    $^H{bignum} = 1;                                    # we are in effect
 
-  # for newer Perls override hex() and oct() with a lexical version:
-  if ($] > 5.009004)
-    {
-    bigint::_override();
+    # for newer Perls override hex() and oct() with a lexical version:
+    if ($] > 5.009004) {
+        bigint::_override();
     }
 
-  # some defaults
-  my $lib = ''; my $lib_kind = 'try';
-  my $upgrade = 'Math::BigFloat';
-  my $downgrade = 'Math::BigInt';
-
-  my @import = ( ':constant' );				# drive it w/ constant
-  my @a = @_; my $l = scalar @_; my $j = 0;
-  my ($ver,$trace);					# version? trace?
-  my ($a,$p);						# accuracy, precision
-  for ( my $i = 0; $i < $l ; $i++,$j++ )
-    {
-    if ($_[$i] eq 'upgrade')
-      {
-      # this causes upgrading
-      $upgrade = $_[$i+1];		# or undef to disable
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] eq 'downgrade')
-      {
-      # this causes downgrading
-      $downgrade = $_[$i+1];		# or undef to disable
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(l|lib|try|only)$/)
-      {
-      # this causes a different low lib to take care...
-      $lib_kind = $1; $lib_kind = 'lib' if $lib_kind eq 'l';
-      $lib = $_[$i+1] || '';
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(a|accuracy)$/)
-      {
-      $a = $_[$i+1];
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(p|precision)$/)
-      {
-      $p = $_[$i+1];
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(v|version)$/)
-      {
-      $ver = 1;
-      splice @a, $j, 1; $j --;
-      }
-    elsif ($_[$i] =~ /^(t|trace)$/)
-      {
-      $trace = 1;
-      splice @a, $j, 1; $j --;
-      }
-    elsif ($_[$i] !~ /^(PI|e|bexp|bpi|hex|oct)\z/)
-      {
-      die ("unknown option $_[$i]");
-      }
+    # some defaults
+    my $lib       = '';
+    my $lib_kind  = 'try';
+    my $upgrade   = 'Math::BigFloat';
+    my $downgrade = 'Math::BigInt';
+
+    my @import = (':constant');                 # drive it w/ constant
+    my @a = @_;
+    my $l = scalar @_;
+    my $j = 0;
+    my ($ver, $trace);                          # version? trace?
+    my ($a, $p);                                # accuracy, precision
+    for (my $i = 0; $i < $l; $i++, $j++) {
+        if ($_[$i] eq 'upgrade') {
+            # this causes upgrading
+            $upgrade = $_[$i + 1];              # or undef to disable
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        } elsif ($_[$i] eq 'downgrade') {
+            # this causes downgrading
+            $downgrade = $_[$i + 1];            # or undef to disable
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        } elsif ($_[$i] =~ /^(l|lib|try|only)$/) {
+            # this causes a different low lib to take care...
+            $lib_kind = $1;
+            $lib_kind = 'lib' if $lib_kind eq 'l';
+            $lib = $_[$i + 1] || '';
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        }
+        elsif ($_[$i] =~ /^(a|accuracy)$/) {
+            $a = $_[$i + 1];
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        }
+        elsif ($_[$i] =~ /^(p|precision)$/) {
+            $p = $_[$i + 1];
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        }
+        elsif ($_[$i] =~ /^(v|version)$/) {
+            $ver = 1;
+            splice @a, $j, 1;
+            $j--;
+        }
+        elsif ($_[$i] =~ /^(t|trace)$/) {
+            $trace = 1;
+            splice @a, $j, 1;
+            $j--;
+        }
+        elsif ($_[$i] !~ /^(PI|e|bexp|bpi|hex|oct)\z/) {
+            die ("unknown option $_[$i]");
+        }
     }
-  my $class;
-  $_lite = 0;					# using M::BI::L ?
-  if ($trace)
-    {
-    require Math::BigInt::Trace; $class = 'Math::BigInt::Trace';
-    $upgrade = 'Math::BigFloat::Trace';	
+    my $class;
+    $_lite = 0;                                 # using M::BI::L ?
+    if ($trace) {
+        require Math::BigInt::Trace;
+        $class   = 'Math::BigInt::Trace';
+        $upgrade = 'Math::BigFloat::Trace';
     }
-  else
-    {
-    # see if we can find Math::BigInt::Lite
-    if (!defined $a && !defined $p)		# rounding won't work to well
-      {
-      if (eval { require Math::BigInt::Lite; 1 })
-        {
-        @import = ( );				# :constant in Lite, not MBI
-        Math::BigInt::Lite->import( ':constant' );
-        $_lite= 1;				# signal okay
+    else {
+        # see if we can find Math::BigInt::Lite
+        if (!defined $a && !defined $p) {       # rounding won't work to well
+            if (eval { require Math::BigInt::Lite; 1 }) {
+                @import = ();                   # :constant in Lite, not MBI
+                Math::BigInt::Lite->import(':constant');
+                $_lite = 1;                     # signal okay
+            }
         }
-      }
-    require Math::BigInt if $_lite == 0;	# not already loaded?
-    $class = 'Math::BigInt';			# regardless of MBIL or not
+        require Math::BigInt if $_lite == 0;    # not already loaded?
+        $class = 'Math::BigInt';                # regardless of MBIL or not
     }
-  push @import, $lib_kind => $lib if $lib ne ''; 
-  # Math::BigInt::Trace or plain Math::BigInt
-  $class->import(@import, upgrade => $upgrade);
-
-  if ($trace)
-    {
-    require Math::BigFloat::Trace; $class = 'Math::BigFloat::Trace';
-    $downgrade = 'Math::BigInt::Trace';	
+    push @import, $lib_kind => $lib if $lib ne '';
+    # Math::BigInt::Trace or plain Math::BigInt
+    $class->import(@import, upgrade => $upgrade);
+
+    if ($trace) {
+        require Math::BigFloat::Trace;
+        $class     = 'Math::BigFloat::Trace';
+        $downgrade = 'Math::BigInt::Trace';
     }
-  else
-    {
-    require Math::BigFloat; $class = 'Math::BigFloat';
+    else {
+        require Math::BigFloat;
+        $class = 'Math::BigFloat';
     }
-  $class->import(':constant','downgrade',$downgrade);
-
-  bignum->accuracy($a) if defined $a;
-  bignum->precision($p) if defined $p;
-  if ($ver)
-    {
-    print "bignum\t\t\t v$VERSION\n";
-    print "Math::BigInt::Lite\t v$Math::BigInt::Lite::VERSION\n" if $_lite;
-    print "Math::BigInt\t\t v$Math::BigInt::VERSION";
-    my $config = Math::BigInt->config();
-    print " lib => $config->{lib} v$config->{lib_version}\n";
-    print "Math::BigFloat\t\t v$Math::BigFloat::VERSION\n";
-    exit;
+    $class->import(':constant', 'downgrade', $downgrade);
+
+    bignum->accuracy($a)  if defined $a;
+    bignum->precision($p) if defined $p;
+    if ($ver) {
+        print "bignum\t\t\t v$VERSION\n";
+        print "Math::BigInt::Lite\t v$Math::BigInt::Lite::VERSION\n" if $_lite;
+        print "Math::BigInt\t\t v$Math::BigInt::VERSION";
+        my $config = Math::BigInt->config();
+        print " lib => $config->{lib} v$config->{lib_version}\n";
+        print "Math::BigFloat\t\t v$Math::BigFloat::VERSION\n";
+        exit;
     }
 
-  # Take care of octal/hexadecimal constants
-  overload::constant binary => sub { bigint::_binary_constant(shift) };
+    # Take care of octal/hexadecimal constants
+    overload::constant binary =>
+        sub {
+            bigint::_binary_constant(shift);
+        };
 
-  # if another big* was already loaded:
-  my ($package) = caller();
+    # if another big* was already loaded:
+    my ($package) = caller();
 
-  no strict 'refs';
-  if (!defined *{"${package}::inf"})
-    {
-    $self->export_to_level(1,$self,@a);           # export inf and NaN
+    no strict 'refs';
+    if (!defined *{"${package}::inf"}) {
+        $self->export_to_level(1, $self, @a);   # export inf and NaN
     }
-  }
+}
 
 sub PI () { Math::BigFloat->new('3.141592653589793238462643383279502884197'); }
 sub e () { Math::BigFloat->new('2.718281828459045235360287471352662497757'); }
 sub bpi ($) { Math::BigFloat::bpi(@_); }
-sub bexp ($$) { my $x = Math::BigFloat->new($_[0]); $x->bexp($_[1]); }
+sub bexp ($$) {
+    my $x = Math::BigFloat->new($_[0]);
+    $x->bexp($_[1]);
+}
 
 1;
 
@@ -223,14 +225,14 @@ bignum - Transparent BigNumber support for Perl
 
   use bignum;
 
-  $x = 2 + 4.5,"\n";			# BigFloat 6.5
-  print 2 ** 512 * 0.1,"\n";		# really is what you think it is
-  print inf * inf,"\n";			# prints inf
-  print NaN * 3,"\n";			# prints NaN
+  $x = 2 + 4.5,"\n";                    # BigFloat 6.5
+  print 2 ** 512 * 0.1,"\n";            # really is what you think it is
+  print inf * inf,"\n";                 # prints inf
+  print NaN * 3,"\n";                   # prints NaN
 
   {
     no bignum;
-    print 2 ** 256,"\n";		# a normal Perl scalar now
+    print 2 ** 256,"\n";                # a normal Perl scalar now
   }
 
   # for older Perls, import into current package:
@@ -244,7 +246,7 @@ All operators (including basic math operations) are overloaded. Integer and
 floating-point constants are created as proper BigInts or BigFloats,
 respectively.
 
-If you do 
+If you do
 
         use bignum;
 
@@ -302,7 +304,7 @@ appropriately. This means that:
 
 will work correctly. These mixed cases don't do always work when using
 Math::BigInt or Math::BigFloat alone, or at least not in the way normal Perl
-scalars work. 
+scalars work.
 
 If you do want to work with large integers like under C<use integer;>, try
 C<use bigint;>:
@@ -350,7 +352,7 @@ The following options exist:
 This sets the accuracy for all math operations. The argument must be greater
 than or equal to zero. See Math::BigInt's bround() function for details.
 
-	perl -Mbignum=a,50 -le 'print sqrt(20)'
+        perl -Mbignum=a,50 -le 'print sqrt(20)'
 
 Note that setting precision and accuracy at the same time is not possible.
 
@@ -361,7 +363,7 @@ integer. Negative values mean a fixed number of digits after the dot, while
 a positive value rounds to this digit left from the dot. 0 or 1 mean round to
 integer. See Math::BigInt's bfround() function for details.
 
-	perl -Mbignum=p,-50 -le 'print sqrt(20)'
+        perl -Mbignum=p,-50 -le 'print sqrt(20)'
 
 Note that setting precision and accuracy at the same time is not possible.
 
@@ -374,12 +376,12 @@ Math::BigInt/Math::BigFloat.
 
 Load a different math lib, see L<Math Library>.
 
-	perl -Mbignum=l,GMP -e 'print 2 ** 512'
+        perl -Mbignum=l,GMP -e 'print 2 ** 512'
 
 Currently there is no way to specify more than one library on the command
 line. This means the following does not work:
 
-	perl -Mbignum=l,GMP,Pari -e 'print 2 ** 512'
+        perl -Mbignum=l,GMP,Pari -e 'print 2 ** 512'
 
 This will be hopefully fixed soon ;)
 
@@ -401,7 +403,7 @@ overridden in the current scope whenever the bigint pragma is active.
 
 This prints out the name and version of all modules used and then exits.
 
-	perl -Mbignum=v
+        perl -Mbignum=v
 
 =back
 
@@ -466,36 +468,36 @@ handle bareword C<NaN> properly.
 
 =item e
 
-	# perl -Mbignum=e -wle 'print e'
+        # perl -Mbignum=e -wle 'print e'
 
 Returns Euler's number C<e>, aka exp(1).
 
 =item PI()
 
-	# perl -Mbignum=PI -wle 'print PI'
+        # perl -Mbignum=PI -wle 'print PI'
 
 Returns PI.
 
 =item bexp()
 
-	bexp($power,$accuracy);
+        bexp($power,$accuracy);
 
 Returns Euler's number C<e> raised to the appropriate power, to
 the wanted accuracy.
 
 Example:
 
-	# perl -Mbignum=bexp -wle 'print bexp(1,80)'
+        # perl -Mbignum=bexp -wle 'print bexp(1,80)'
 
 =item bpi()
 
-	bpi($accuracy);
+        bpi($accuracy);
 
 Returns PI to the wanted accuracy.
 
 Example:
 
-	# perl -Mbignum=bpi -wle 'print bpi(80)'
+        # perl -Mbignum=bpi -wle 'print bpi(80)'
 
 =item upgrade()
 
@@ -504,13 +506,13 @@ C<$Math::BigInt::upgrade>.
 
 =item in_effect()
 
-	use bignum;
+        use bignum;
 
-	print "in effect\n" if bignum::in_effect;	# true
-	{
-	  no bignum;
-	  print "in effect\n" if bignum::in_effect;	# false
-	}
+        print "in effect\n" if bignum::in_effect;       # true
+        {
+          no bignum;
+          print "in effect\n" if bignum::in_effect;     # false
+        }
 
 Returns true or false if C<bignum> is in effect in the current scope.
 
@@ -523,16 +525,16 @@ This method only works on Perl v5.9.4 or later.
 Math with the numbers is done (by default) by a module called
 Math::BigInt::Calc. This is equivalent to saying:
 
-	use bignum lib => 'Calc';
+        use bignum lib => 'Calc';
 
 You can change this by using:
 
-	use bignum lib => 'GMP';
+        use bignum lib => 'GMP';
 
 The following would first try to find Math::BigInt::Foo, then
 Math::BigInt::Bar, and when this also fails, revert to Math::BigInt::Calc:
 
-	use bignum lib => 'Foo,Math::BigInt::Bar';
+        use bignum lib => 'Foo,Math::BigInt::Bar';
 
 Please see respective module documentation for further details.
 
@@ -540,11 +542,11 @@ Using C<lib> warns if none of the specified libraries can be found and
 L<Math::BigInt> did fall back to one of the default libraries.
 To suppress this warning, use C<try> instead:
 
-	use bignum try => 'GMP';
+        use bignum try => 'GMP';
 
 If you want the code to die instead of falling back, use C<only> instead:
 
-	use bignum only => 'GMP';
+        use bignum only => 'GMP';
 
 =head2 INTERNAL FORMAT
 
@@ -607,22 +609,22 @@ will not happen unless you specifically ask for it with the two
 import tags "hex" and "oct" - and then it will be global and cannot be
 disabled inside a scope with "no bigint":
 
-	use bigint qw/hex oct/;
+        use bigint qw/hex oct/;
 
-	print hex("0x1234567890123456");
-	{
-		no bigint;
-		print hex("0x1234567890123456");
-	}
+        print hex("0x1234567890123456");
+        {
+                no bigint;
+                print hex("0x1234567890123456");
+        }
 
 The second call to hex() will warn about a non-portable constant.
 
 Compare this to:
 
-	use bigint;
+        use bigint;
 
-	# will warn only under older than v5.9.4
-	print hex("0x1234567890123456");
+        # will warn only under older than v5.9.4
+        print hex("0x1234567890123456");
 
 =back
 
@@ -634,24 +636,24 @@ the others to do the work.
 
 The following modules are currently used by bignum:
 
-	Math::BigInt::Lite	(for speed, and only if it is loadable)
-	Math::BigInt
-	Math::BigFloat
+        Math::BigInt::Lite      (for speed, and only if it is loadable)
+        Math::BigInt
+        Math::BigFloat
 
 =head1 EXAMPLES
 
 Some cool command line examples to impress the Python crowd ;)
 
-	perl -Mbignum -le 'print sqrt(33)'
-	perl -Mbignum -le 'print 2*255'
-	perl -Mbignum -le 'print 4.5+2*255'
-	perl -Mbignum -le 'print 3/7 + 5/7 + 8/3'
-	perl -Mbignum -le 'print 123->is_odd()'
-	perl -Mbignum -le 'print log(2)'
-	perl -Mbignum -le 'print exp(1)'
-	perl -Mbignum -le 'print 2 ** 0.5'
-	perl -Mbignum=a,65 -le 'print 2 ** 0.2'
-	perl -Mbignum=a,65,l,GMP -le 'print 7 ** 7777'
+        perl -Mbignum -le 'print sqrt(33)'
+        perl -Mbignum -le 'print 2*255'
+        perl -Mbignum -le 'print 4.5+2*255'
+        perl -Mbignum -le 'print 3/7 + 5/7 + 8/3'
+        perl -Mbignum -le 'print 123->is_odd()'
+        perl -Mbignum -le 'print log(2)'
+        perl -Mbignum -le 'print exp(1)'
+        perl -Mbignum -le 'print 2 ** 0.5'
+        perl -Mbignum=a,65 -le 'print 2 ** 0.2'
+        perl -Mbignum=a,65,l,GMP -le 'print 7 ** 7777'
 
 =head1 LICENSE
 
diff --git a/dist/bignum/lib/bigrat.pm b/dist/bignum/lib/bigrat.pm
index b02831b..61b6526 100644
--- a/dist/bignum/lib/bigrat.pm
+++ b/dist/bignum/lib/bigrat.pm
@@ -1,209 +1,211 @@
 package bigrat;
 use 5.006;
 
-$VERSION = '0.39';
+$VERSION = '0.40';
 require Exporter;
-...@ISA		= qw( bigint );
-...@EXPORT_OK 	= qw( PI e bpi bexp hex oct );
-...@EXPORT		= qw( inf NaN );
+...@ISA            = qw( bigint );
+...@EXPORT_OK      = qw( PI e bpi bexp hex oct );
+...@EXPORT         = qw( inf NaN );
 
 use strict;
 use overload;
 use bigint ();
 
-############################################################################## 
+##############################################################################
 
-BEGIN 
-  {
-  *inf = \&bigint::inf;
-  *NaN = \&bigint::NaN;
-  *hex = \&bigint::hex;
-  *oct = \&bigint::oct;
-  }
+BEGIN {
+    *inf = \&bigint::inf;
+    *NaN = \&bigint::NaN;
+    *hex = \&bigint::hex;
+    *oct = \&bigint::oct;
+}
 
 # These are all alike, and thus faked by AUTOLOAD
 
 my @faked = qw/round_mode accuracy precision div_scale/;
-use vars qw/$VERSION $AUTOLOAD $_lite/;		# _lite for testsuite
-
-sub AUTOLOAD
-  {
-  my $name = $AUTOLOAD;
-
-  $name =~ s/.*:://;    # split package
-  no strict 'refs';
-  foreach my $n (@faked)
-    {
-    if ($n eq $name)
-      {
-      *{"bigrat::$name"} = sub 
-        {
-        my $self = shift;
-        no strict 'refs';
-        if (defined $_[0])
-          {
-          Math::BigInt->$name($_[0]);
-          Math::BigFloat->$name($_[0]);
-          return Math::BigRat->$name($_[0]);
-          }
-        return Math::BigInt->$name();
-        };
-      return &$name;
-      }
+use vars qw/$VERSION $AUTOLOAD $_lite/; # _lite for testsuite
+
+sub AUTOLOAD {
+    my $name = $AUTOLOAD;
+
+    $name =~ s/.*:://;          # split package
+    no strict 'refs';
+    foreach my $n (@faked) {
+        if ($n eq $name) {
+            *{"bigrat::$name"} =
+              sub {
+                  my $self = shift;
+                  no strict 'refs';
+                  if (defined $_[0]) {
+                      Math::BigInt->$name($_[0]);
+                      Math::BigFloat->$name($_[0]);
+                      return Math::BigRat->$name($_[0]);
+                  }
+                  return Math::BigInt->$name();
+              };
+            return &$name;
+        }
     }
- 
-  # delayed load of Carp and avoid recursion
-  require Carp;
-  Carp::croak ("Can't call bigrat\-\>$name, not a valid method");
-  }
 
-sub unimport
-  {
-  $^H{bigrat} = undef;					# no longer in effect
-  overload::remove_constant('binary','','float','','integer');
-  }
+    # delayed load of Carp and avoid recursion
+    require Carp;
+    Carp::croak ("Can't call bigrat\-\>$name, not a valid method");
+}
 
-sub in_effect
-  {
-  my $level = shift || 0;
-  my $hinthash = (caller($level))[10];
-  $hinthash->{bigrat};
-  }
+sub unimport {
+    $^H{bigrat} = undef;        # no longer in effect
+    overload::remove_constant('binary', '', 'float', '', 'integer');
+}
+
+sub in_effect {
+    my $level = shift || 0;
+    my $hinthash = (caller($level))[10];
+    $hinthash->{bigrat};
+}
 
 #############################################################################
 
-sub import 
-  {
-  my $self = shift;
+sub import {
+    my $self = shift;
 
-  # see also bignum->import() for additional comments
+    # see also bignum->import() for additional comments
 
-  $^H{bigrat} = 1;					# we are in effect
+    $^H{bigrat} = 1;                            # we are in effect
 
-  # for newer Perls always override hex() and oct() with a lexical version:
-  if ($] > 5.009004)
-    {
-    bigint::_override();
+    # for newer Perls always override hex() and oct() with a lexical version:
+    if ($] > 5.009004) {
+        bigint::_override();
     }
-  # some defaults
-  my $lib = ''; my $lib_kind = 'try'; my $upgrade = 'Math::BigFloat';
-
-  my @import = ( ':constant' );				# drive it w/ constant
-  my @a = @_; my $l = scalar @_; my $j = 0;
-  my ($a,$p);
-  my ($ver,$trace);					# version? trace?
-  for ( my $i = 0; $i < $l ; $i++,$j++ )
-    {
-    if ($_[$i] eq 'upgrade')
-      {
-      # this causes upgrading
-      $upgrade = $_[$i+1];		# or undef to disable
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s;
-      }
-    elsif ($_[$i] =~ /^(l|lib|try|only)$/)
-      {
-      # this causes a different low lib to take care...
-      $lib_kind = $1; $lib_kind = 'lib' if $lib_kind eq 'l';
-      $lib = $_[$i+1] || '';
-      my $s = 2; $s = 1 if @a-$j < 2;	# avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(a|accuracy)$/)
-      {
-      $a = $_[$i+1];
-      my $s = 2; $s = 1 if @a-$j < 2;   # avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(p|precision)$/)
-      {
-      $p = $_[$i+1];
-      my $s = 2; $s = 1 if @a-$j < 2;   # avoid "can not modify non-existent..."
-      splice @a, $j, $s; $j -= $s; $i++;
-      }
-    elsif ($_[$i] =~ /^(v|version)$/)
-      {
-      $ver = 1;
-      splice @a, $j, 1; $j --;
-      }
-    elsif ($_[$i] =~ /^(t|trace)$/)
-      {
-      $trace = 1;
-      splice @a, $j, 1; $j --;
-      }
-    elsif ($_[$i] !~ /^(PI|e|bpi|bexp|hex|oct)\z/)
-      {
-      die ("unknown option $_[$i]");
-      }
+    # some defaults
+    my $lib      = '';
+    my $lib_kind = 'try';
+    my $upgrade  = 'Math::BigFloat';
+
+    my @import = (':constant');                 # drive it w/ constant
+    my @a = @_;
+    my $l = scalar @_;
+    my $j = 0;
+    my ($a, $p);
+    my ($ver, $trace);                          # version? trace?
+    for (my $i = 0; $i < $l ; $i++, $j++) {
+        if ($_[$i] eq 'upgrade') {
+            # this causes upgrading
+            $upgrade = $_[$i + 1];              # or undef to disable
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+        }
+        elsif ($_[$i] =~ /^(l|lib|try|only)$/) {
+            # this causes a different low lib to take care...
+            $lib_kind = $1;
+            $lib_kind = 'lib' if $lib_kind eq 'l';
+            $lib = $_[$i + 1] || '';
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        }
+        elsif ($_[$i] =~ /^(a|accuracy)$/) {
+            $a = $_[$i + 1];
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        }
+        elsif ($_[$i] =~ /^(p|precision)$/) {
+            $p = $_[$i + 1];
+            my $s = 2;
+            $s = 1 if @a - $j < 2;  # avoid "can not modify non-existent..."
+            splice @a, $j, $s;
+            $j -= $s;
+            $i++;
+        }
+        elsif ($_[$i] =~ /^(v|version)$/) {
+            $ver = 1;
+            splice @a, $j, 1;
+            $j--;
+        }
+        elsif ($_[$i] =~ /^(t|trace)$/) {
+            $trace = 1;
+            splice @a, $j, 1;
+            $j--;
+        }
+        elsif ($_[$i] !~ /^(PI|e|bpi|bexp|hex|oct)\z/) {
+            die ("unknown option $_[$i]");
+        }
     }
-  my $class;
-  $_lite = 0;                                   # using M::BI::L ?
-  if ($trace)
-    {
-    require Math::BigInt::Trace; $class = 'Math::BigInt::Trace';
-    $upgrade = 'Math::BigFloat::Trace';
+    my $class;
+    $_lite = 0;                                 # using M::BI::L ?
+    if ($trace) {
+        require Math::BigInt::Trace;
+        $class   = 'Math::BigInt::Trace';
+        $upgrade = 'Math::BigFloat::Trace';
     }
-  else
-    {
-    # see if we can find Math::BigInt::Lite
-    if (!defined $a && !defined $p)             # rounding won't work to well
-      {
-      if (eval { require Math::BigInt::Lite; 1 })
-        {
-        @import = ( );                          # :constant in Lite, not MBI
-        Math::BigInt::Lite->import( ':constant' );
-        $_lite= 1;                              # signal okay
+    else {
+        # see if we can find Math::BigInt::Lite
+        if (!defined $a && !defined $p) {       # rounding won't work to well
+            if (eval { require Math::BigInt::Lite; 1 }) {
+                @import = ();                   # :constant in Lite, not MBI
+                Math::BigInt::Lite->import(':constant');
+                $_lite = 1;                     # signal okay
+            }
         }
-      }
-    require Math::BigInt if $_lite == 0;        # not already loaded?
-    $class = 'Math::BigInt';                    # regardless of MBIL or not
+        require Math::BigInt if $_lite == 0;    # not already loaded?
+        $class = 'Math::BigInt';                # regardless of MBIL or not
     }
-  push @import, $lib_kind => $lib if $lib ne ''; 
-  # Math::BigInt::Trace or plain Math::BigInt
-  $class->import(@import, upgrade => $upgrade);
-
-  require Math::BigFloat;
-  Math::BigFloat->import( upgrade => 'Math::BigRat', ':constant' );
-  require Math::BigRat;
-  Math::BigRat->import( @import );
-
-  bigrat->accuracy($a) if defined $a;
-  bigrat->precision($p) if defined $p;
-  if ($ver)
-    {
-    print "bigrat\t\t\t v$VERSION\n";
-    print "Math::BigInt::Lite\t v$Math::BigInt::Lite::VERSION\n" if $_lite;  
-    print "Math::BigInt\t\t v$Math::BigInt::VERSION";
-    my $config = Math::BigInt->config();
-    print " lib => $config->{lib} v$config->{lib_version}\n";
-    print "Math::BigFloat\t\t v$Math::BigFloat::VERSION\n";
-    print "Math::BigRat\t\t v$Math::BigRat::VERSION\n";
-    exit;
+    push @import, $lib_kind => $lib if $lib ne '';
+    # Math::BigInt::Trace or plain Math::BigInt
+    $class->import(@import, upgrade => $upgrade);
+
+    require Math::BigFloat;
+    Math::BigFloat->import(upgrade => 'Math::BigRat', ':constant');
+    require Math::BigRat;
+    Math::BigRat->import(@import);
+
+    bigrat->accuracy($a)  if defined $a;
+    bigrat->precision($p) if defined $p;
+    if ($ver) {
+        print "bigrat\t\t\t v$VERSION\n";
+        print "Math::BigInt::Lite\t v$Math::BigInt::Lite::VERSION\n" if $_lite;
+        print "Math::BigInt\t\t v$Math::BigInt::VERSION";
+        my $config = Math::BigInt->config();
+        print " lib => $config->{lib} v$config->{lib_version}\n";
+        print "Math::BigFloat\t\t v$Math::BigFloat::VERSION\n";
+        print "Math::BigRat\t\t v$Math::BigRat::VERSION\n";
+        exit;
     }
 
-  # Take care of octal/hexadecimal constants
-  overload::constant binary => sub { bigint::_binary_constant(shift) };
+    # Take care of octal/hexadecimal constants
+    overload::constant binary =>
+        sub {
+            bigint::_binary_constant(shift);
+          };
 
-  # if another big* was already loaded:
-  my ($package) = caller();
+    # if another big* was already loaded:
+    my ($package) = caller();
 
-  no strict 'refs';
-  if (!defined *{"${package}::inf"})
-    {
-    $self->export_to_level(1,$self,@a);           # export inf and NaN
+    no strict 'refs';
+    if (!defined *{"${package}::inf"}) {
+        $self->export_to_level(1, $self, @a);   # export inf and NaN
     }
-  }
+}
 
 sub PI () { Math::BigFloat->new('3.141592653589793238462643383279502884197'); }
 sub e () { Math::BigFloat->new('2.718281828459045235360287471352662497757'); }
 
-sub bpi ($) { local $Math::BigFloat::upgrade; Math::BigFloat::bpi(@_); }
+sub bpi ($) {
+    local $Math::BigFloat::upgrade;
+    Math::BigFloat::bpi(@_);
+}
 
-sub bexp ($$)
-  {
-  local $Math::BigFloat::upgrade;
-  my $x = Math::BigFloat->new($_[0]); $x->bexp($_[1]);
-  }
+sub bexp ($$) {
+    local $Math::BigFloat::upgrade;
+    my $x = Math::BigFloat->new($_[0]);
+    $x->bexp($_[1]);
+}
 
 1;
 
@@ -217,12 +219,12 @@ bigrat - Transparent BigNumber/BigRational support for Perl
 
   use bigrat;
 
-  print 2 + 4.5,"\n";			# BigFloat 6.5
-  print 1/3 + 1/4,"\n";			# produces 7/12
+  print 2 + 4.5,"\n";                   # BigFloat 6.5
+  print 1/3 + 1/4,"\n";                 # produces 7/12
 
   {
     no bigrat;
-    print 1/3,"\n";			# 0.33333...
+    print 1/3,"\n";                     # 0.33333...
   }
 
   # Import into current package:
@@ -257,7 +259,7 @@ The following modules are currently used by bignum:
 Math with the numbers is done (by default) by a module called
 Math::BigInt::Calc. This is equivalent to saying:
 
-	use bigrat lib => 'Calc';
+        use bigrat lib => 'Calc';
 
 You can change this by using:
 
@@ -266,7 +268,7 @@ You can change this by using:
 The following would first try to find Math::BigInt::Foo, then
 Math::BigInt::Bar, and when this also fails, revert to Math::BigInt::Calc:
 
-	use bigrat lib => 'Foo,Math::BigInt::Bar';
+        use bigrat lib => 'Foo,Math::BigInt::Bar';
 
 Using C<lib> warns if none of the specified libraries can be found and
 L<Math::BigInt> did fall back to one of the default libraries.
@@ -310,37 +312,36 @@ handle bareword C<NaN> properly.
 
 =item e
 
-	# perl -Mbigrat=e -wle 'print e'
+        # perl -Mbigrat=e -wle 'print e'
 
 Returns Euler's number C<e>, aka exp(1).
 
 =item PI
 
-	# perl -Mbigrat=PI -wle 'print PI'
+        # perl -Mbigrat=PI -wle 'print PI'
 
 Returns PI.
 
 =item bexp()
 
-	bexp($power,$accuracy);
-
+        bexp($power,$accuracy);
 
 Returns Euler's number C<e> raised to the appropriate power, to
 the wanted accuracy.
 
 Example:
 
-	# perl -Mbigrat=bexp -wle 'print bexp(1,80)'
+        # perl -Mbigrat=bexp -wle 'print bexp(1,80)'
 
 =item bpi()
 
-	bpi($accuracy);
+        bpi($accuracy);
 
 Returns PI to the wanted accuracy.
 
 Example:
 
-	# perl -Mbigrat=bpi -wle 'print bpi(80)'
+        # perl -Mbigrat=bpi -wle 'print bpi(80)'
 
 =item upgrade()
 
@@ -349,13 +350,13 @@ C<$Math::BigInt::upgrade>.
 
 =item in_effect()
 
-	use bigrat;
+        use bigrat;
 
-	print "in effect\n" if bigrat::in_effect;	# true
-	{
-	  no bigrat;
-	  print "in effect\n" if bigrat::in_effect;	# false
-	}
+        print "in effect\n" if bigrat::in_effect;       # true
+        {
+          no bigrat;
+          print "in effect\n" if bigrat::in_effect;     # false
+        }
 
 Returns true or false if C<bigrat> is in effect in the current scope.
 
@@ -377,7 +378,7 @@ only a shallow copy will be made.
 
 If you want to make a real copy, use the following:
 
-	$y = $x->copy();
+        $y = $x->copy();
 
 Using the copy or the original with overloaded math is okay, e.g. the
 following work:
@@ -418,7 +419,7 @@ The following options exist:
 This sets the accuracy for all math operations. The argument must be greater
 than or equal to zero. See Math::BigInt's bround() function for details.
 
-	perl -Mbigrat=a,50 -le 'print sqrt(20)'
+        perl -Mbigrat=a,50 -le 'print sqrt(20)'
 
 Note that setting precision and accuracy at the same time is not possible.
 
@@ -429,7 +430,7 @@ integer. Negative values mean a fixed number of digits after the dot, while
 a positive value rounds to this digit left from the dot. 0 or 1 mean round to
 integer. See Math::BigInt's bfround() function for details.
 
-	perl -Mbigrat=p,-50 -le 'print sqrt(20)'
+        perl -Mbigrat=p,-50 -le 'print sqrt(20)'
 
 Note that setting precision and accuracy at the same time is not possible.
 
@@ -442,12 +443,12 @@ Math::BigInt/Math::BigFloat.
 
 Load a different math lib, see L<MATH LIBRARY>.
 
-	perl -Mbigrat=l,GMP -e 'print 2 ** 512'
+        perl -Mbigrat=l,GMP -e 'print 2 ** 512'
 
 Currently there is no way to specify more than one library on the command
 line. This means the following does not work:
 
-	perl -Mbignum=l,GMP,Pari -e 'print 2 ** 512'
+        perl -Mbignum=l,GMP,Pari -e 'print 2 ** 512'
 
 This will be hopefully fixed soon ;)
 
@@ -469,7 +470,7 @@ overridden in the current scope whenever the bigrat pragma is active.
 
 This prints out the name and version of all modules used and then exits.
 
-	perl -Mbigrat=v
+        perl -Mbigrat=v
 
 =back
 
@@ -512,33 +513,33 @@ will not happen unless you specifically ask for it with the two
 import tags "hex" and "oct" - and then it will be global and cannot be
 disabled inside a scope with "no bigint":
 
-	use bigint qw/hex oct/;
+        use bigint qw/hex oct/;
 
-	print hex("0x1234567890123456");
-	{
-		no bigint;
-		print hex("0x1234567890123456");
-	}
+        print hex("0x1234567890123456");
+        {
+                no bigint;
+                print hex("0x1234567890123456");
+        }
 
 The second call to hex() will warn about a non-portable constant.
 
 Compare this to:
 
-	use bigint;
+        use bigint;
 
-	# will warn only under Perl older than v5.9.4
-	print hex("0x1234567890123456");
+        # will warn only under Perl older than v5.9.4
+        print hex("0x1234567890123456");
 
 =back
 
 =head1 EXAMPLES
 
-	perl -Mbigrat -le 'print sqrt(33)'
-	perl -Mbigrat -le 'print 2*255'
-	perl -Mbigrat -le 'print 4.5+2*255'
-	perl -Mbigrat -le 'print 3/7 + 5/7 + 8/3'
-	perl -Mbigrat -le 'print 12->is_odd()';
-	perl -Mbignum=l,GMP -le 'print 7 ** 7777'
+        perl -Mbigrat -le 'print sqrt(33)'
+        perl -Mbigrat -le 'print 2*255'
+        perl -Mbigrat -le 'print 4.5+2*255'
+        perl -Mbigrat -le 'print 3/7 + 5/7 + 8/3'
+        perl -Mbigrat -le 'print 12->is_odd()';
+        perl -Mbignum=l,GMP -le 'print 7 ** 7777'
 
 =head1 LICENSE
 
-- 
2.4.5


Recent Messages in this Thread
(Peter J. Acklam) (via RT) Aug 29, 2015 09:45 am
(Peter J. Acklam) via RT Aug 29, 2015 12:02 pm
Tony Cook via RT Sep 02, 2015 01:27 am
Ricardo Signes Sep 02, 2015 01:49 am
Tony Cook Sep 02, 2015 02:14 am
Ricardo Signes Sep 02, 2015 02:20 am
Tony Cook via RT Sep 02, 2015 05:18 am
(Peter J. Acklam) via RT Sep 02, 2015 07:47 am
Karl Williamson Sep 03, 2015 04:36 am
Tony Cook via RT Sep 03, 2015 04:31 am
(Peter J. Acklam) via RT Sep 04, 2015 11:45 am
Ricardo Signes Sep 04, 2015 11:51 am
(Peter J. Acklam) via RT Sep 04, 2015 02:24 pm
Messages in this thread