bit.band

From Garry's Mod
Revision as of 18:17, 23 December 2017 by Protocs (Talk | contribs)
Jump to: navigation, search
 bit.band( )

Contents

Description

Performs the bitwise "and" for all values specified.

Arguments

number value

The value to be manipulated.

Arguments

number otherValues=nil

Values bit to perform bitwise "and" with. Optional.

Returns

number

Result of bitwise "and" operation.

Examples

Example

a = 170    -- 10101010 in binary form
b = 146    -- 10010010 in binary form
print( bit.band( a, b ) )

Output:

130 (10000010 in binary form)
Personal tools
Navigation