Name

& (bitwise AND)

Examples
a = 207    # In binary: 11001111
b = 61     # In binary: 00111101
c = a & b  # In binary: 00001101
print(c) # Prints "13", the decimal equivalent to 00001101
argb = color(204, 204, 51, 255)
# The sytax "& 0xFF" compares the binary
# representation of the two values and
# makes all but the last 8 bits into a 0.
# "0xFF" is 00000000000000000000000011111111
a = argb >> 24 & 0xFF
r = argb >> 16 & 0xFF
g = argb >> 8 & 0xFF
b = argb & 0xFF
fill(r, g, b, a)
rect(30, 20, 55, 55)
Description
Syntax
value & value2
Parameters
value1
value2
Related | (bitwise OR)
binary()
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License