4 ms·
Just to make sure this is clear: bigint libraries do not use strings. A well coded big int library will use an array of ints. When an overflow is detected (the
by green7ea 13y ago
Just to make sure this is clear: bigint libraries do not use strings.
A well coded big int library will use an array of ints. When an overflow is detected (the processor has a flag for this) you expand the array appropriately.
Some libraries don't wait to detect the overflow, in fact they compute how many bytes are required for a certain operation (easy to do with bitmasks) and allocate the appropriate size ahead of time (this is useful if you overflow often)