Metropoli BBS
VIEWER: add.txt MODE: TEXT (ASCII)
a # 1 61 R ' c # a add b                                                 '
a # a,[1]  '"add - multiprecision integer addition.                      '
a # a,[1]  '"from ''the apl handbook of techniques'' copyright 1978, ibm.  '
a # a,[1]  '"-add a to b, givin c, using multiprecision integer          '
a # a,[1]  '" arithmetic (i.e. truncating all results to mp integers).   '
a # a,[1]  '"-a and b are numeric values.                                '
a # a,[1]  '" they may be: integer or floating point, of either          '
a # a,[1]  '"              ordinary or extended precision.               '
a # a,[1]  '"-c will be a multiprecision integer (zero exponent)         '
a # a,[1]  '"-and extended precision number, integer or floating point,  '
a # a,[1]  '" is represented by an integer vector of consecutive 1-7     '
a # a,[1]  '" decimal digit segments, the first of which is the exponent,'
a # a,[1]  '" zero for integers.  all segments have the same sign, with  '
a # a,[1]  '" the exception of the exponent.(see fadd). leading zeros    '
a # a,[1]  '" are eliminated.                                            '
a # a,[1]  '"-use fix to convert a numeric variable to mp integer form.  '
a # a,[1]  '"-the multiprecision integer arithmetic package comprises:   '
a # a,[1]  '" add sub mul div sqrt fix can rounds.                       '
a # a,[1]  '"-functions of the multiprecision integer                    '
a # a,[1]  '" arithmetic package are used the the multi-                 '
a # a,[1]  '" precision floating point arithmetic package.               '
a # a,[1]  '"-uses: fix can                                              '
a # a,[1]  'c#can`O(cY`Oa)+(c#(Ra#fix a)SRb)Y`Ob#fix b                   '
Lfx a
[ RETURN TO DIRECTORY ]