Java Bit Clean clearBitsUpToLS(int n, int i)

Here you can find the source of clearBitsUpToLS(int n, int i)

Description

clear Bits Up To LS

License

Open Source License

Declaration

public static int clearBitsUpToLS(int n, int i) 

Method Source Code

//package com.java2s;
/*//  ww w . j  a v  a  2  s .c  o m
 * MIT Licensed
 * Copyright 2014 REM <rami.developer@gmail.com>.
 */

public class Main {
    public static int clearBitsUpToLS(int n, int i) {
        return n & ~(-1 >> (31 - i));
    }
}

Related

  1. clearBit(long n, int i)
  2. clearBit33ofDTS(byte[] array, int offset)
  3. clearBits(int value, int bits)
  4. clearBits(long value, long bits)
  5. clearBitsAfterInLastWord(int lastWord, int lastSetBit)