I want to compare two multiplication methods implemented in Java which use shift operations on big numbers. Thus I need sufficiently large BigIntegers.
Since I want to compare them bit-wise, what would be the best approach to generate BigIntegers with n bits which are fully used in the multiplication operation.
My approach so far is this:
byte[] bits = new byte[bitLength]; BigInteger number = new BigInteger(bits).flipBit(bitLength);