Java BigInteger to convertPositive(BigInteger bi)

Here you can find the source of convertPositive(BigInteger bi)

Description

convert Positive

License

Apache License

Declaration

public static BigInteger convertPositive(BigInteger bi) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.math.BigInteger;

public class Main {
    public static BigInteger convertPositive(BigInteger bi) {
        if (bi.signum() < 0) {
            bi = new BigInteger(1, bi.toByteArray());
        }//from   w  w  w.j  a va 2 s.  com
        return bi;
    }
}

Related

  1. concat(BigInteger left, BigInteger right)
  2. convert(BigInteger value, int base, boolean extra)
  3. convertAllElementsToLong(P bigIntegers)
  4. convertBigIntegerIntoInetAddress(final BigInteger i)
  5. convertBigIntegerToNBytes( final BigInteger bigInteger, final int numBytes)
  6. convertRealNumberBits(BigInteger source, int size, int direction)
  7. convertRepresentation(BigInteger b)
  8. convertToBase62String(BigInteger value)
  9. convertToLong(BigInteger bigInteger)