function add(%x, %y)
{
%a = 1;
while (%a)
{
%a = %x & %y;
%b = %x ^ %y;
%x = %a << 1;
%y = %b;
}
return %b;
}
==>echo(add(5, -3));
2
==>echo(add(100, 50));
150
==>echo(add(-999999, -65000));
-1064999
Obligatory obvious fact: Numbers where abs(n) > 999999 work just fine.
Note: That other topic about addition has nothing to do with this.