A system used to manage integers with specific memory sizes.
This is the base class for Both the Uint
and Int
classes. It includes basic
functionality that includes formatting when toString
and Symbol.toStringTag
are called.
The name of the class, used to format Object.toString
.
Whether or not to clamp the values rather than wrap them.
This is the numerical value of the instance. Setting this will automatically fix the value within the instance's bounds.
Extends TypedInteger
.
Base class of the Unsigned Integer types.
The maximum value that the Uint
can store.
Get the maximum value of the variable from the number of bits it will be stored in.
Parameters:
bits: number
- The size in bits.
Returns: The maximum value of a Uint with the given size.
Uint.Uint8
-Uint
with 8 bits of storage.Uint.Uint8Clamped
- ClampedUint
with 8 bits of storage.Uint.Uint16
-Uint
with 16 bits of storage.Uint.Uint16Clamped
- ClampedUint
with 16 bits of storage.Uint.Uint32
-Uint
with 32 bits of storage.Uint.Uint32Clamped
- ClampedUint
with 32 bits of storage.Uint.Uint64
-Uint
with 64 bits of storage.Uint.Uint64Clamped
- ClampedUint
with 64 bits of storage.
Extends TypedInteger
.
Base class of the Signed Integer types.
The minimum and maximum value that the Int
can store.
Get the maximum and minimum value of the variable from the number of bits it will be stored in.
Parameters:
bits: number
- The size in bits.
Returns: The maximum and minimum values of a Iint with the given size.
Int.Int8
-Int
with 8 bits of storage.Int.Int8Clamped
- ClampedInt
with 8 bits of storage.Int.Int16
-Int
with 16 bits of storage.Int.Int16Clamped
- ClampedInt
with 16 bits of storage.Int.Int32
-Int
with 32 bits of storage.Int.Int32Clamped
- ClampedInt
with 32 bits of storage.Int.Int64
-Int
with 64 bits of storage.Int.Int64Clamped
- ClampedInt
with 64 bits of storage.