I tried looking on the forum on how to handle digits larger than 16. So far I found this post:
How can I handle numbers bigger than 17-digits in Firefox/IE7?
which does not provide a solution but only recommends to do some tricks to handle the operations.
I also looked online for libraries that could cope with this, such as this library, which is again limited by 15 digits.
http://mikemcl.github.io/decimal.js/#precision
What other ways are there to handle arithmetic operations for numbers with digits larger than 15?
Try looking for decimal math and arbitrary precision libraries.
"Decimal math" means it operates on decimal digits instead of binary digits.
Arbitrary precision means without hard limits on number of digits.
Is there a decimal math library for JavaScript? might be a good starting point.