I am looking for a Java library that can handle really huge numbers or suggestions on how to implement this yourself. We talk about this above BigInteger . How about 2 ^ 39614081257132168796771974655 + 1 .
Clearly, theoretically, I could use TreeSet<BigInteger> , one write per bit and do the whole math school, but I'm looking for something that can actually do some real math with these numbers using the built-in math hardware. I do not expect anything really fast, but I would really like to get closer.
Probably the number of set bits can be quite small - I represent the polynomials G2.
Does anyone know anything there?
I suspect the package function should be setBit(BigInteger i) .
Added
Thanks for the suggestion of Apfloat . Unfortunately, impossible. He complains that the second parameter should be long .
Apint two = new Apint(2); Apint big = new Apint("39614081257132168796771974655"); ApintMath.pow(two, big);
Please note that I am also open to suggestions on how to do this myself.
Added - to reopen.
Please see user2246674 post , reminding us how tremendously huge these numbers are. I can assure you, we are not talking about some ordinary mathematical library, we are talking about serious Math.pow(age-of-the-universe,atoms-in_the_galaxy) kind of numbers - we , of course , are not looking for simple stubborn answers.
source share