Java BigInteger Calculate unsignedToBigInteger(long l)

Here you can find the source of unsignedToBigInteger(long l)

Description

unsigned To Big Integer

License

Open Source License

Declaration

public static BigInteger unsignedToBigInteger(long l) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.math.BigInteger;

public class Main {
    private static final BigInteger BI_2_64 = BigInteger.ONE.shiftLeft(64);

    public static BigInteger unsignedToBigInteger(long l) {
        final BigInteger bi = BigInteger.valueOf(l);
        return l >= 0 ? bi : bi.add(BI_2_64);
    }/*from  w  ww  .j  a  va  2 s  . c om*/
}

Related

  1. trim(BigInteger n)
  2. trimToPrecision(BigInteger number, int precision)
  3. uint64ToByteStreamLE(BigInteger val, OutputStream stream)
  4. unsignedBigIntergerToByteArray(BigInteger bigInteger)
  5. unsignedLongToBigInteger(byte[] source)
  6. writeBigInteger(BigInteger integer, DataOutputStream out)
  7. writeBigInteger(BigInteger m, int n, OutputStream os)
  8. writeBigInteger(ByteArrayOutputStream baos, BigInteger bi)
  9. writeBigInteger(ByteArrayOutputStream stream, BigInteger num)