bit.band

From Garry's Mod
Revision as of 15:54, 23 December 2018 by Zaros (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

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

Output:

130 (10000010 in binary form)
Personal tools
Navigation