a # 1 60 R ' c#a div b;q;t ' a # a,[1] '"multiprecision integer divide with remainder ' a # a,[1] ' $(2^=Rb#fix b)/l2 ' a # a,[1] '"special code for speed if b is scalar ' a # a,[1] ' $c#(2X(b#1Ub)=1Yrem#0,1Ya#fix a)R0 ' a # a,[1] 'l1:c#c,q#D(t#10000000Brem,1Ya)%b ' a # a,[1] ' rem#0,t_qXb ' a # a,[1] ' $(0|1U2Yb ' a # a,[1] ' $0 ' a # a,[1] '"div - multiprecision integer division ' a # a,[1] '"from ''the apl handbook of techniques'' copyright 1978, ibm. ' a # a,[1] '"-divide a by b, giving c, using multiprecision integer ' a # a,[1] '" arithmetic; a and b may be in any numeric format, c will ' a # a,[1] '" be mp integer. see Gadd. ' a # a,[1] '"-uses: Gadd Gsub Gmul Gfix Gcan ' Lfx a