1lytics

Bitwise functions

Gorgeous Karnaugh scripting engine provides some bitwise functions to replace and extend Lua bitwise operators. All Gorgeous Karnaugh bitwise functions have prefix 'b' to differ with Lua operators and doesn't have the 'gk' prefix to make names shorter.

  • bnot - performs bitwise negation (or complement) of input value
  • band - performs bitwise multiplication (conjunction) of input values
  • bnand - short form for expression bnot(band(...))
  • bor - performs bitwise addition (disjunction) of input values
  • bnor - short form for expression bnot(bor(...))
  • bxor - performs bitwise 'exclusive or' operation of input values
  • bxnor - short form for expression bnot(bxor(...))

bnot

The bnot bitwise function performs bitwise negation (or complement) of input value.

Usage

bnot(val)

band

The band bitwise function performs bitwise multiplication (conjunction) of input values. It accepts unlimited number of input values, but it can't be less than 2.

Usage

band(val1,val2[,...])

bnand

The bnand function is the short form for expression bnot(band(...)).

Usage

bnand(val1,val2[,...])

bor

The bor bitwise function performs bitwise addition (disjunction) of input values. It accepts unlimited number of input values, but it can't be less than 2.

Usage

bor(val1,val2[,...])

bnor

The bnor function is the short form for expression bnot(bor(...)).

Usage

bnor(val1,val2[,...])

bxor

The bxor bitwise function performs bitwise 'exclusive or' operation of input values. It accepts unlimited number of input values, but it can't be less than 2. Meaning of this operation for number of inputs greater then 2 you can see in sample near below.

Usage

bxor(val1,val2[,...])

bxnor

The bxnor function is the short form for expression bnot(bxor(...)).

Usage

bxnor(val1,val2[,...])