Invert GMLscripts.com

bit_test

bits = 229;               //  bits == 229 (11100101)
test = bit_test(bits,4);  //  test == 0   (...^....)
test = bit_test(bits,5);  //  test == 1   (..^.....)
bit_test(bitfield,bit)
Returns the state of a bit within a given bitfield.
COPY/// bit_test(bitfield,bit)
//
//  Returns the state of a bit within a given bitfield.
//
//      bitfield    number or group of bits, integer
//      bit         bit index to test, integer
//
/// GMLscripts.com/license
{
    return 1 & (argument0 >> argument1);
}

Contributors: xot

GitHub: View · Commits · Blame · Raw