a # 1 60 R ' c#a fadd b;m ' a # a,[1] ' m#D/c#(1Ya#float a),1Yb#float b ' a # a,[1] ' c#(S/c),1U(0,1U(m_-1Yc)Ua)add 0,1U(m_1Yc)Ub ' a # a,[1] ' $0 ' a # a,[1] '"fadd - multiprecision floating point addition ' a # a,[1] '"from ''the apl handbook of techniques'' copyright 1978, ibm. ' a # a,[1] '"-a and b are numeric variables. ' a # a,[1] '" they may be: integer or floating point of either ordinary ' a # a,[1] '" or extended precision. ' a # a,[1] '"-the result will be multiprecision floating point. ' a # a,[1] '"-a multiprecision floating point number has the same format' a # a,[1] '" as a multiprecision integer (i.e. integer vector; see ' a # a,[1] '" description under Gadd). the leading integer (exponent) ' a # a,[1] '" indicates how many 1-7 digit elements from the right end ' a # a,[1] '" of the number the decimal point belongs. if negative, ' a # a,[1] '" move #. ' a # a,[1] '"-numberic variables of any format may be converted into ' a # a,[1] '" mp floating point by the function float. ' a # a,[1] '"-the precision of a multiprecision floating point number ' a # a,[1] '" is indicated by its length, and all multiprecision ' a # a,[1] '" floating point operations set the length of the result ' a # a,[1] '" according to the precision of the operands. in ' a # a,[1] '" particular, the result of an add or subtract has a ' a # a,[1] '" precision such that its least significant element is ' a # a,[1] '" governed by the significance of the operand of greater ' a # a,[1] '" magnitude. ' a # a,[1] '"-the nultiprecision floating poin arithmetic package ' a # a,[1] '" comprises: Gfadd Gfsub Gfmul Gfdiv Gfloat Gfsqrt ' a # a,[1] '" Gfexp Gpi Galprec Gformat Gscale ' a # a,[1] '"-fadd uses: Gfloat Gadd ' Lfx a