# _a : accuracy
# _p : precision
-$VERSION = '1.998';
+$VERSION = '1.999';
require 5.006002;
require Exporter;
return $x if $x->modify('bneg');
- # for +0 dont negate (to have always normalized +0). Does nothing for 'NaN'
+ # for +0 do not negate (to have always normalized +0). Does nothing for 'NaN'
$x->{sign} =~ tr/+-/-+/ unless ($x->{sign} eq '+' && $MBI->_is_zero($x->{_m}));
$x;
}
($x->{_e},$x->{_es}) = _e_sub($x->{_e}, $MBI->_new($scale), $x->{_es}, '+');
$x->bnorm(); # remove trailing 0's
}
- } # ende else $x != $y
+ } # end else $x != $y
# shortcut to not run through _find_round_parameters again
if (defined $params[0])
# simulate old behaviour
$params[0] = $self->div_scale(); # and round to it as accuracy
$scale = $params[0]+4; # at least four more for proper round
- $params[2] = $r; # iound mode by caller or undef
+ $params[2] = $r; # round mode by caller or undef
$fallback = 1; # to clear a/p afterwards
}
else
my $zad = 0; # zeros after dot
$zad = $dad - $len if (-$dad < -$len); # for 0.00..00xxx style
- # p rint "scale $scale dad $dad zad $zad len $len\n";
+ # print "scale $scale dad $dad zad $zad len $len\n";
# number bsstr len zad dad
# 0.123 123e-3 3 0 3
# 0.0123 123e-4 3 1 4
if $MBI->_is_zero($x->{_m});
}
- $x; # MBI bnorm is no-op, so dont call it
+ $x; # MBI bnorm is no-op, so do not call it
}
##############################################################################
my $class = "Math::BigInt";
use 5.006002;
-$VERSION = '1.9991';
+$VERSION = '1.9992';
@ISA = qw(Exporter);
@EXPORT_OK = qw(objectify bgcd blcm);
},
# the original qw() does not work with the TIESCALAR below, why?
-# Order of arguments unsignificant
+# Order of arguments insignificant
'""' => sub { $_[0]->bstr(); },
'0+' => sub { $_[0]->numify(); }
;
return $x if $x->modify('bneg');
- # for +0 dont negate (to have always normalized +0). Does nothing for 'NaN'
+ # for +0 do not negate (to have always normalized +0). Does nothing for 'NaN'
$x->{sign} =~ tr/+-/-+/ unless ($x->{sign} eq '+' && $CALC->_is_zero($x->{value}));
$x;
}
return -1 if $x->{sign} eq '-' && $y->{sign} eq '+'; # does also -x <=> 0
# have same sign, so compare absolute values. Don't make tests for zero here
- # because it's actually slower than testin in Calc (especially w/ Pari et al)
+ # because it's actually slower than testing in Calc (especially w/ Pari et al)
# post-normalized compare for internal use (honors signs)
if ($x->{sign} eq '+')
}
# $x && $y both < 0
- $CALC->_acmp($y->{value},$x->{value}); # swaped acmp (lib returns 0,1,-1)
+ $CALC->_acmp($y->{value},$x->{value}); # swapped acmp (lib returns 0,1,-1)
}
sub bacmp
}
else
{
- $rem->{sign} = '+'; # dont leave -0
+ $rem->{sign} = '+'; # do not leave -0
}
$rem->round(@r);
return ($x,$rem);
}
else
{
- $x->{sign} = '+'; # dont leave -0
+ $x->{sign} = '+'; # do not leave -0
}
$x->round(@r);
}
$x->bsgn();
Signum function. Set the number to -1, 0, or 1, depending on whether the
-number is negative, zero, or positive, respectivly. Does not modify NaNs.
+number is negative, zero, or positive, respectively. Does not modify NaNs.
=head2 bnorm()
use 5.006002;
use strict;
-# use warnings; # dont use warnings for older Perls
+# use warnings; # do not use warnings for older Perls
-our $VERSION = '1.997';
+our $VERSION = '1.998';
# Package to store unsigned big integers in decimal and do math with them
# Beware of things like:
# $i = $i * $y + $car; $car = int($i / $BASE); $i = $i % $BASE;
-# This works on x86, but fails on ARM (SA1100, iPAQ) due to whoknows what
+# This works on x86, but fails on ARM (SA1100, iPAQ) due to who knows what
# reasons. So, use this instead (slower, but correct):
# $i = $i * $y + $car; $car = int($i / $BASE); $i -= $BASE * $car;
else {
- # Make a copy of the original n, since we'll be modifing n in-place.
+ # Make a copy of the original n, since we'll be modifying n in-place.
my $n_orig = _copy($c, $n);
use 5.006002;
use strict;
-# use warnings; # dont use warnings for older Perls
+# use warnings; # do not use warnings for older Perls
use vars qw/$VERSION/;
-$VERSION = '1.999';
+$VERSION = '1.9991';
package Math::BigInt;