alias math+ {
;$1=A, $2=B
; A+B=C
var %a = $gettok($1,1,46), %b = $gettok($2,1,46)
var %y = $gettok($1,2,46), %z = $gettok($2,2,46)
var %c = $null, %r = 0, %w = 0
if ($len(%a) < $len(%b)) %a = $str(0,$calc($v2 - $v1)) $+ %a
elseif ($len(%b) < $len(%a)) %b = $str(0,$calc($v2 - $v1)) $+ %b
if ($len(%y) < $len(%z)) %y = %y $+ $str(0,$calc($v2 - $v1))
elseif ($len(%z) < $len(%y)) %z = %z $+ $str(0,$calc($v2 - $v1))
var %i = $len(%y), %ii = 0
while (%i > %ii) {
%w = $calc($mid(%y,%i,1) + $mid(%z,%i,1) + %r)
%c = $+($right(%w,1),%c)
%r = $left(%w,-1)
dec %i
}
if (%c > 0) %c = $+(.,%c)
var %i = $len(%a), %ii = 0
while (%i > %ii) {
%w = $calc($mid(%a,%i,1) + $mid(%b,%i,1) + %r)
%c = $+($right(%w,1),%c)
%r = $left(%w,-1)
dec %i
}
if (%r > 0) %c = $+(%r,%c)
return %c
}