Math::BaseArith

Math::BaseArith is a Perl extension for mixed-base number representation (like APL encode/decode).
Download

Math::BaseArith Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Gary Puckering
  • Publisher web site:
  • http://search.cpan.org/~puckering/Math-BaseArith-1.00/BaseArith.pm

Math::BaseArith Tags


Math::BaseArith Description

Math::BaseArith is a Perl extension for mixed-base number representation (like APL encode/decode). Math::BaseArith is a Perl extension for mixed-base number representation (like APL encode/decode).SYNOPSIS use Math::BaseArith; encode( value, base_list ); decode( representation_list, base_list );The inspiration for this module is a pair of functions in the APL programming language called encode (a.k.a. "representation") and decode (a.k.a. base-value). Their principal use is to convert numbers from one number base to another. Mixed number bases are permitted.In this perl implementation, the representation of a number in a particular number base consists of a list whose elements are the digit values in that base. For example, the decimal number 31 would be expressed in binary as a list of five ones with any number of leading zeros: . The same number expressed as three hexadecimal (base 16) digits would be , while in base 10 it would be . Fifty-one inches would be expressed in yards, feet, inches as , an example of a mixed number base.In the following description of encode and decode, Q will mean an abstract value or quantity, R will be its representation and B will define the number base. Q will be a perl scalar; R and B are perl lists. The values in R correspond to the radix values in B.In the examples below, assume the output of print has been altered by setting $, = ' ' and that => is your shell prompt. Requirements: · Perl


Math::BaseArith Related Software