Java examples for java.lang:int Binary
Returns the lowest bit value
//package com.java2s; public class Main { /**//from www . j a v a 2 s . com * Returns the lowest bit value * @param value The byte to check * @return 0 or 1 value of lowest bit */ public static int getLowestBit(byte value) { return getLowestBit((int) value); } /** * Retruns the lowest bit value * @param value The int to check * @return 0 or 1 value of lowest bit */ public static int getLowestBit(int value) { return (Integer.lowestOneBit(value) == 1) ? 1 : 0; } }