04-03-2025, 06:12 PM
https://qb64phoenix.com/forum/showthread.php?tid=787 -- I have. 
The one important thing that I want to bring to people's attention is string math doesn't need to be one digit at a time.
999 plus
999
------
Most folks who write string math will solve that one digit at a time. 9+9 =18 18... Write the 8, carry the 1...
999+
999
------
??8 (Carry 1)
Then they solve the next single character. 9 + 9 + 1...
999+
999
-----
?98 (carry 1)
Only 1 digit at a time... BUT!! There's no reason for that! Base 100 math follows the same rule set. 99 + 99 =198... which is 98 (carry 1). Base 1000 math is the same... and so on...
So why not read 17 digits at a time as an unsigned integer 64, and do all that in a single calculation?? It's much faster than trying to go a single character at a time.
Same with multiplication, but to a lesser degree. I think you can multiply 8 or 9 digits by 8 or 9 digits and have no overflow. It's not as efficient as addition, but it's still much better than just a single digit at once.

The one important thing that I want to bring to people's attention is string math doesn't need to be one digit at a time.
999 plus
999
------
Most folks who write string math will solve that one digit at a time. 9+9 =18 18... Write the 8, carry the 1...
999+
999
------
??8 (Carry 1)
Then they solve the next single character. 9 + 9 + 1...
999+
999
-----
?98 (carry 1)
Only 1 digit at a time... BUT!! There's no reason for that! Base 100 math follows the same rule set. 99 + 99 =198... which is 98 (carry 1). Base 1000 math is the same... and so on...
So why not read 17 digits at a time as an unsigned integer 64, and do all that in a single calculation?? It's much faster than trying to go a single character at a time.
Same with multiplication, but to a lesser degree. I think you can multiply 8 or 9 digits by 8 or 9 digits and have no overflow. It's not as efficient as addition, but it's still much better than just a single digit at once.