Java BigInteger Calculate maskBits(BigInteger value, int bits)

Here you can find the source of maskBits(BigInteger value, int bits)

Description

mask Bits

License

Open Source License

Declaration

public static BigInteger maskBits(BigInteger value, int bits) 

Method Source Code

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

import java.math.BigInteger;

public class Main {

    public static BigInteger maskBits(BigInteger value, int bits) {
        BigInteger mask = BigInteger.ONE.shiftLeft(bits).subtract(BigInteger.ONE);
        return value.and(mask);
    }//from w w  w. j  a  v  a2s . c  o  m
}

Related

  1. intValueExact(BigInteger bigint)
  2. jsonBigInteger(JsonValue value)
  3. length(BigInteger bi)
  4. listToBigInteger(List list)
  5. log2(BigInteger x)
  6. min(BigInteger a, BigInteger b)
  7. modPow(BigInteger base, BigInteger e, BigInteger m)
  8. modPowByte(byte[] arg, BigInteger e, BigInteger n)
  9. modPowLong(BigInteger n, long exponent, BigInteger modulo)