Here you can find the source of clearBits(long value, long bits)
Parameter | Description |
---|---|
value | the value. |
bits | the bits to clear. |
public static long clearBits(long value, long bits)
//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 ww.j a v a 2 s . co m * Clears the bits of a value. * @param value the value. * @param bits the bits to clear. * @return the resulting number. */ public static long clearBits(long value, long bits) { return value & ~bits; } /** * Clears the bits of a value. * @param value the value. * @param bits the bits to clear. * @return the resulting number. */ public static int clearBits(int value, int bits) { return value & ~bits; } }