SplitScript reference / i32

i32

Built-in type

i32

Stores a 32-bit signed integer.

Unconstrained integer literals and values specifically constrained as Integer default to i32. Memory reads never use this default and require an explicit or otherwise exact representation.

Examples

Use i32

let health: i32 = process.read(healthAddress) else 0

Capabilities

MemberDescriptionAvailable through
DebugProduces an unambiguous structural representation of a value.
IntegerIdentifies integral numeric types.
MemoryReadableSupports deserialization from process memory.
SignedIdentifies signed numeric types.

Operators

MemberDescriptionAvailable through
==Reports whether this value and another value are equal.Available through Equatable
!=Reports whether this value and another value differ.Available through Equatable
&Combines two integers with a bitwise AND.Available through Integer
!Returns the width-preserving bitwise complement of this integer.Available through Integer
|Combines two integers with a bitwise OR.Available through Integer
^Combines two integers with a bitwise exclusive OR.Available through Integer
%Returns the remainder after integer division.Available through Integer
<<Shifts bits to the left.Available through Integer
>>Shifts bits to the right.Available through Integer
+Adds another value of the same numeric type.Available through Numeric
/Divides by another value of the same numeric type.Available through Numeric
*Multiplies by another value of the same numeric type.Available through Numeric
-Subtracts another value of the same numeric type.Available through Numeric
-Returns this value with its sign inverted.Available through Signed

Methods

MemberDescriptionAvailable through
debugStringConverts the receiver to its unambiguous structural representation.Available through Debug
toStringConverts the receiver to its user-facing string representation.Available through Display
toStringFormats this integer using a positional numeral system.Available through Integer
clampRestricts a numeric value to an inclusive range.Available through Numeric
maxReturns the larger of two numeric values.Available through Numeric
minReturns the smaller of two numeric values.Available through Numeric
squaredMultiplies this value by itself.Available through Numeric
swapBytesReverses the order of the bytes in this numeric value.Available through Numeric
absReturns this value without a negative sign.Available through Signed