Does BigInteger ever overflows?

前端 未结 5 479
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-17 13:25

The API docs says

All of the details in the Spec concerning overflow are ignored, as BigIntegers are made as large as necessary to accommodate the r

5条回答
  •  青春惊慌失措
    2021-01-17 14:21

    Correct, BigInteger never overflows, it uses software operations and dynamic allocation to store arbitrarily sized numbers.

    As with all things in computing, "arbitrarily sized" is anothe way of saying "until you run out of resources on the underlying system".

提交回复
热议问题