Java Utililty Methods BigInteger Reverse

List of utility methods to do BigInteger Reverse

Description

The list of methods to do BigInteger Reverse are organized into topic(s).

Method

BigIntegerreverse(BigInteger currentSum)
reverse
String num = currentSum.toString();
String rev = new StringBuilder(num).reverse().toString();
BigInteger revNum = new BigInteger(rev);
return revNum;
BigIntegerreverse(BigInteger n)
reverse
String s = n.toString();
StringBuilder sb = new StringBuilder(s);
return new BigInteger(sb.reverse().toString());
BigIntegerreverse(BigInteger x, int width)
reverse
try {
    if (width < Long.SIZE)
        return BigInteger.valueOf(reverse(x.longValueExact(), width));
} catch (ArithmeticException ex) {
StringBuilder str = new StringBuilder(x.toString(2));
if (str.length() > width)
    str.delete(0, str.length() - width);
...