Attached is a file containing one hundred 50-digit numbers. The program will read the 100 numbers into an array and add them together, displaying the sum and also writing it to a file since it's unlikely to fit the whole number on screen.
dim num$(100)
open to read 1, "c:\programming\numbers.txt"
for i = 1 to 100
read string 1, num$(i)
next i
close file 1
bigSum$ = ""
carryOver = 0
for d = 50 to 1 step -1
sum = carryOver
for n = 1 to 100
sum = sum + val(mid$(num$(n), d))
next n
s$ = str$(sum)
bigSum$ = right$(s$,1) + bigSum$
carryOver = val(left$(s$, len(s$)-1))
next d
bigSum$ = str$(carryOver) + bigSum$
if file exist("c:\programming\sum.txt") then delete file "c:\programming\sum.txt"
open to write 1, "c:\programming\sum.txt"
write string 1, bigSum$
close file 1
print bigSum$
wait key
end
It will convert the numbers into strings and work out an answer much like a person would work it out by hand. Because the final sum being calculated is stored as a string, it's internal size in bytes is equal to how many digits it uses. For example, while 42 stored as a number only requires 1 byte of memory, it would require 2 bytes to store as a string.
A double integer (the largest data type available in DB) uses 8 bytes and handles numbers up to 9,223,372,036,854,775,807. Anything larger than that (more than 19 digits) and the language can't natively handle it as a "number". This example uses numbers of 50 digits, more than twice what we could natively support.
Your signature has been erased by a mod please reduce it to 600 x 120.