Math::Base::Convert::CalcPP(3) standard methods used by Math::Base::Convert

DESCRIPTION

This module contains the standard methods used by Math::Base::Convert to convert from one base number to another base number.
  • $carry = addbaseno($reg32ptr,$int)

    This function adds an integer < 65536 to a long n*32 bit register and returns the carry.

  • multiply($reg32ptr,$int)

    This function multiplies a long n*32 bit register by an integer < 65536

  • ($qptr,$remainder) = dividebybase($reg32ptr,$int)

    this function divides a long n*32 bit register by an integer < 65536 and returns a pointer to a long n*32 bit quotient and an integer remainder.

  • $bc->useFROMbaseto32wide

    This method converts FROM an input base string to a long n*32 bit register using an algorithim like:

            $longnum = 0;
            for $char ( $in_str =~ /./g ) {
              $longnum *= $base;
              $longnum += $value{$char)
            }
            return $number;
    
  • $output = $bc->use32wideTObase

    This method converts a long n*32 bit register TO a base number using an algorithim like:

        $output = '';
        while( $longnum > 0 ) {
          $output = ( $longnum % $base ) . $output;
          $num = int( $longnum / $base );
        }
        return $output;
    

AUTHOR

Michael Robinton, [email protected]

COPYRIGHT

Copyright 2012-15, Michael Robinton

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.