strAdd("100", "-50")
strAdd("100", "-100")
strAdd("100000", "-50000")
strAdd("100000", "-100000")
Those are what are called "Sign Rules", adding a positive and a negative number is really just subtracting, and i have yet to do the Subtraction function. In other words, only Positives will work.
I found a online application that adds 2 very large random numbers together, and i'm testing it using that as I speak.
But just for some confirmation; It does work correctly.
Sounds like your browser is messed up.
Try "save as" ?
It's a DSi. I can't "Save As" unfourtanetly.
EDIT: I just looked at your script... Almost none of that ScriptObject stuff is needed. My adding code is only 29 lines (without decimals).
Here it is, and it works 100%. If you wanna test it; try adding "32412345673735723456126234763
4" and "12652357348634652345132465674
7", it should come out as:
45064703022370375801258700438
1
And also, equ0s is a function to equal out the length of the 2 strings, like
21287345 and
923
would become
21287345 and
00000923
Although im not 100% sure that's nessesary, because it might display as false, which displays as 0.
function stringAdd(%num1, %num2)
{
if(!(isValidInteger(%num1) && isValidInteger(%num2)))
return "invalidNumber";
%num1 = getWord(equ0s(%num1, %num2), 0);
%num2 = getWord(equ0s(%num1, %num2), 1);
for(%a=0;%a<strLen(%num1);%a++)
{
%start[%a] = getSubStr(%num1, %a, 1);
%adder[%a] = getSubStr(%num2, %a, 1);
}
%Length = strLen(%num1);
for(%a = %Length - 1; %a >= 0; %a--)
{
%res = %start[%a] + %adder[%a] + %Carry;
if(%res > 9 && %a != 0)
{
%Carry = 1;
%Ans[%a] = %res - 10;
continue;
}
if(%res < 10)
%Carry = 0;
%Ans[%a] = %res;
}
for(%a = 0; %a < %length; %a++)
%Answer = %Answer @ %Ans[%a];
return %Answer;
}