use vars qw/@ISA $VERSION/;
@ISA = qw(Exporter);
-$VERSION = '0.27';
+$VERSION = '0.28';
# Package to store unsigned big integers in decimal and do math with them
}
# since multiplying $x with $x fails, make copy in this case
- $yv = [@$xv] if "$xv" eq "$yv"; # same references?
+ $yv = [@$xv] if $xv == $yv; # same references?
+# $yv = [@$xv] if "$xv" eq "$yv"; # same references?
+
# since multiplying $x with $x would fail here, use the faster squaring
-# return _square($c,$xv) if "$xv" eq "$yv"; # same reference?
+# return _square($c,$xv) if $xv == $yv; # same reference?
if ($LEN_CONVERT != 0)
{
# since multiplying $x with $x fails, make copy in this case
- $yv = [@$xv] if "$xv" eq "$yv"; # same references?
+ $yv = [@$xv] if $xv == $yv; # same references?
+# $yv = [@$xv] if "$xv" eq "$yv"; # same references?
# since multiplying $x with $x would fail here, use the faster squaring
-# return _square($c,$xv) if "$xv" eq "$yv"; # same reference?
+# return _square($c,$xv) if $xv == $yv; # same reference?
if ($LEN_CONVERT != 0)
{
return $x;
}
- my $y = [ @$yorg ];
+ my $y = [ @$yorg ]; # always make copy to preserve
if ($LEN_CONVERT != 0)
{
$c->_to_small($x); $c->_to_small($y);
return $x;
}
- my $y = [ @$yorg ];
+ my $y = [ @$yorg ]; # always make copy to preserve
if ($LEN_CONVERT != 0)
{
$c->_to_small($x); $c->_to_small($y);
$x;
}
+sub _modinv
+ {
+ # inverse modulus
+ }
+
+sub _modpow
+ {
+ # modulus of power ($x ** $y) % $z
+ }
+
##############################################################################
##############################################################################
_gcd(obj,obj) return Greatest Common Divisor of two objects
_zeros(obj) return number of trailing decimal zeros
+ _modinv return inverse modulus
+ _modpow return modulus of power ($x ** $y) % $z
Input strings come in as unsigned but with prefix (i.e. as '123', '0xabc'
or '0b1101').