I am dealing with an arbitrarily large numbers, which is beyond the capacity of modern computer(I am talking about larger than 64 bits number here). How I'll represent them in my program while I will do operations on them?
-
6quite a blatant duplicate of Handling extremely large numbers in a language which can't? – gnat Apr 2 '16 at 17:43
-
Multiple variables and multiplication? – Mast Apr 2 '16 at 17:50
If you want arbitrary-precision numbers, that means implementing basic arithmetic operations in software instead of hardware so you can work with variable-length arrays of bytes.
Many languages already provide this functionality as part of their standard library, and the others probably have a third-party library for it somewhere. Such a class is often called BigDecimal
.