Here you can find the source of bitIsSet(long value, long test)
Parameter | Description |
---|---|
value | the value. |
test | the testing bits. |
public static boolean bitIsSet(long value, long test)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009-2016 Black Rook Software * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html ******************************************************************************/ public class Main { /**//from w w w . j a v a 2s . c o m * Checks if bits are set in a value. * @param value the value. * @param test the testing bits. * @return true if all of the bits set in test are set in value, false otherwise. */ public static boolean bitIsSet(long value, long test) { return (value & test) == test; } }