Maybe I'm really confused because it seems a very simple question but Google and the official documentation were not enough.
I want to copy an BigInteger, and I can't find a clean way of doing it. BigInteger a = b
when b
is a BigInteger, as BigInteger is an object and there's no operator overloading here, a
references to the same object as b
The cleanest way I've found so far is BigInteger a = b.add(BigInteger.ZERO)
, but still a dirty way for me.
BigInteger
is immutable -- there should never be any need to copy a BigInteger
.