⌂ Modules nupp nupp.runtime nupp.runtime.bitops nupp.runtime.bitops.spi nupp.runtime.bitops.spi
Implementation interfaces consumed during ordinary module initialization. Discover with nupp.spi.load; the consumer chooses the unique highest priority. Omitted priority is zero. Importing these declarations loads no implementation.
Module contents Types Type Kind Description Providerinterface 32-bit operations with Lua BitOp semantics.
Types
Providerinterface
32-bit operations with Lua BitOp semantics.
Results are signed integers representing 32-bit words, including logical right shift results whose high bit is set. Inputs normalize to 32 bits; shifts and rotates mask counts to five bits. Variadic operations consume every operand. Providers must preserve these conventions even on hosts with unsigned primitives.
Members Name Kind Description priorityfield tobitmethod Normalizes a numeric operand to a signed 32-bit word. tohexmethod Formats the low requested hexadecimal digits; negative digits select uppercase. rolmethod Rotates left by the low five bits of count. rormethod Rotates right by the low five bits of count. bswapmethod Reverses the four bytes of the normalized word. bandmethod Bitwise conjunction of the first operand and every remaining operand. bormethod Bitwise disjunction of every operand. bxormethod Bitwise exclusive-or of every operand. bnotmethod Inverts all 32 bits. lshiftmethod Shifts left, discarding bits beyond the word. rshiftmethod Shifts right with zero fill, then returns the signed word representation. arshiftmethod Shifts right with sign extension.
tobitmethod
tobit : function ( value : number ) : integer
@readonly
Normalizes a numeric operand to a signed 32-bit word.
Arguments Name Type Description valuenumber
Returns
tohexmethod
tohex : function ( value : number , digits : number ? ) : string
@readonly
Formats the low requested hexadecimal digits; negative digits select uppercase.
Arguments Name Type Description valuenumber digitsnumber ?
Returns
rolmethod
rol : function ( value : number , count : number ) : integer
@readonly
Rotates left by the low five bits of count.
Arguments Name Type Description valuenumber countnumber
Returns
rormethod
ror : function ( value : number , count : number ) : integer
@readonly
Rotates right by the low five bits of count.
Arguments Name Type Description valuenumber countnumber
Returns
bswapmethod
bswap : function ( value : number ) : integer
@readonly
Reverses the four bytes of the normalized word.
Arguments Name Type Description valuenumber
Returns
bandmethod
band : function ( first : number , ... : number ) : integer
@readonly
Bitwise conjunction of the first operand and every remaining operand.
Arguments Name Type Description firstnumber ...number
Returns
bormethod
bor : function ( first : number , ... : number ) : integer
@readonly
Bitwise disjunction of every operand.
Arguments Name Type Description firstnumber ...number
Returns
bxormethod
bxor : function ( first : number , ... : number ) : integer
@readonly
Bitwise exclusive-or of every operand.
Arguments Name Type Description firstnumber ...number
Returns
bnotmethod
bnot : function ( value : number ) : integer
@readonly
Inverts all 32 bits.
Arguments Name Type Description valuenumber
Returns
lshiftmethod
lshift : function ( value : number , count : number ) : integer
@readonly
Shifts left, discarding bits beyond the word.
Arguments Name Type Description valuenumber countnumber
Returns
rshiftmethod
rshift : function ( value : number , count : number ) : integer
@readonly
Shifts right with zero fill, then returns the signed word representation.
Arguments Name Type Description valuenumber countnumber
Returns
arshiftmethod
arshift : function ( value : number , count : number ) : integer
@readonly
Shifts right with sign extension.
Arguments Name Type Description valuenumber countnumber
Returns
← Previous nupp.runtime.bitops Next → nupp.runtime.cancellation