nupp.math.u32
Unsigned 32-bit wrapping arithmetic.
Module contents
Functions
| Function | Kind | Description |
|---|---|---|
add | function | |
andBits | function | |
div | function | Unsigned quotient, or zero when the divisor is zero. |
fromI32 | function | |
leadingZeros | function | |
lessOrEqual | function | |
lessThan | function | |
mod | function | Unsigned remainder, or zero when the divisor is zero. |
mul | function | |
notBits | function | |
orBits | function | |
popcount | function | |
rotateLeft | function | |
rotateRight | function | |
shiftLeft | function | |
shiftRightLogical | function | |
sub | function | |
toI32 | function | |
trailingZeros | function | |
wrap | function | |
xorBits | function |
Functions#
addfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
andBitsfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
divfunction#
Unsigned quotient, or zero when the divisor is zero.
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
fromI32function#
Arguments
| Name | Type | Description |
|---|---|---|
a | int32 |
Returns
| Type | Description |
|---|---|
uint32 |
leadingZerosfunction#
local leadingZeros: function(a: uint32): uint32Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
lessOrEqualfunction#
local lessOrEqual: function(a: uint32, b: uint32): booleanArguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
boolean |
lessThanfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
boolean |
modfunction#
Unsigned remainder, or zero when the divisor is zero.
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
mulfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
notBitsfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
orBitsfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
popcountfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
rotateLeftfunction#
local rotateLeft: function(a: uint32, count: integer): uint32Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
count | integer |
Returns
| Type | Description |
|---|---|
uint32 |
rotateRightfunction#
local rotateRight: function(a: uint32, count: integer): uint32Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
count | integer |
Returns
| Type | Description |
|---|---|
uint32 |
shiftLeftfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
count | integer |
Returns
| Type | Description |
|---|---|
uint32 |
shiftRightLogicalfunction#
local shiftRightLogical: function(a: uint32, count: integer): uint32Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
count | integer |
Returns
| Type | Description |
|---|---|
uint32 |
subfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
toI32function#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 |
Returns
| Type | Description |
|---|---|
int32 |
trailingZerosfunction#
local trailingZeros: function(a: uint32): uint32Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |
wrapfunction#
Arguments
| Name | Type | Description |
|---|---|---|
value | integer |
Returns
| Type | Description |
|---|---|
uint32 |
xorBitsfunction#
Arguments
| Name | Type | Description |
|---|---|---|
a | uint32 | |
b | uint32 |
Returns
| Type | Description |
|---|---|
uint32 |