How can we solve equations having N! constants in it , where N can be of range 1<=N<=10^6 BigInteger can only perform upto 128 bits right?
Even when one do logarithm on both sides, it leaves values bigger than BigInteger.
How can we solve equations having N! constants in it , where N can be of range 1<=N<=10^6 BigInteger can only perform upto 128 bits right?
Even when one do logarithm on both sides, it leaves values bigger than BigInteger.
No, BigInteger
can handle arbitrary sizes of integer (limited by memory). From the documentation:
Immutable arbitrary-precision integers.
(Emphasis mine.)
That's not to say that BigInteger
will necessarily be the right answer to your requirements, but it's worth being aware of its real capabilities before deciding.
Even when one do logarithm on both sides, it leaves values bigger than BigInteger.
let N=10^6
log(N!) ~ NlogN - N [Stirling's approximation]
~ 13e6
this can (easily) fit in int
The implementation of BigInteger is limited to around 2 ^ 2.1 billion bits or about 256 MB. Given its used of int
for bit lengths, this is unlikely to increase.