Range
Represents a range of possible integers by providing a minimum and maximum.
Serialization can error
If the number serialized is outside the range provided, serialization will error. If you instead want to clamp the
input/output, use datatypes.clamp()
function light.datatypes.range
Size
Will use the minimum number of bytes possible to represent the range of possible numbers:
math.abs(maximum - minimum) < n |
Size |
---|---|
n = 256 |
1 Byte |
n = 65,536 |
2 Bytes |
n = 16,777,216 |
3 Bytes |
n = 4,294,967,296 |
4 Bytes |
n = 2 ^ 40 |
5 Bytes |
n = 2 ^ 48 |
6 Bytes |
n = 2 ^ 56 |
7 Bytes |