Integers v0.1.0

Source
The signed and unsigned integer types from 8 to 512 bits and the pointer-sized int and uint, with their width and limit constants. The built-in byte is uint8 and shares its constants.

int

extend int

A target pointer-sized signed integer.

Source

Constants

Bits

pub const Bits: uint = sizeof(int) * 8u;

The target representation width in bits.

Source

Bytes

pub const Bytes: uint = sizeof(int);

The target representation size in bytes.

Source

Min

pub const Min: int = -(((~0u) >> 1u) as int) - 1;

The smallest representable value.

Source

Max

pub const Max: int = ((~0u) >> 1u) as int;

The largest representable value.

Source

int8

extend int8

A signed integer in 8 bits, two's complement.

Source

Constants

Bits

pub const Bits: uint = 8;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 1;

The number of bytes in the representation.

Source

Min

pub const Min: int8 = -128;

The smallest representable value.

Source

Max

pub const Max: int8 = 127;

The largest representable value.

Source

int16

extend int16

A signed integer in 16 bits, two's complement.

Source

Constants

Bits

pub const Bits: uint = 16;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 2;

The number of bytes in the representation.

Source

Min

pub const Min: int16 = -32768;

The smallest representable value.

Source

Max

pub const Max: int16 = 32767;

The largest representable value.

Source

int32

extend int32

A signed integer in 32 bits, two's complement.

Source

Constants

Bits

pub const Bits: uint = 32;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 4;

The number of bytes in the representation.

Source

Min

pub const Min: int32 = -2147483648;

The smallest representable value.

Source

Max

pub const Max: int32 = 2147483647;

The largest representable value.

Source

int64

extend int64

A signed integer in 64 bits, two's complement.

Source

Constants

Bits

pub const Bits: uint = 64;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 8;

The number of bytes in the representation.

Source

Min

pub const Min: int64 = -9223372036854775808;

The smallest representable value.

Source

Max

pub const Max: int64 = 9223372036854775807;

The largest representable value.

Source

int128

extend int128

A signed integer in 128 bits, two's complement.

Source

Constants

Bits

pub const Bits: uint = 128u;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 16u;

The number of bytes in the representation.

Source

Min

pub const Min: int128 = -170141183460469231731687303715884105728i128;

The smallest representable value.

Source

Max

pub const Max: int128 = 170141183460469231731687303715884105727i128;

The largest representable value.

Source

int256

extend int256

A signed integer in 256 bits, two's complement.

Source

Constants

Bits

pub const Bits: uint = 256u;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 32u;

The number of bytes in the representation.

Source

Min

pub const Min: int256 = -57896044618658097711785492504343953926634992332820282019728792003956564819968i256;

The smallest representable value.

Source

Max

pub const Max: int256 = 57896044618658097711785492504343953926634992332820282019728792003956564819967i256;

The largest representable value.

Source

int512

extend int512

A signed integer in 512 bits, two's complement.

Source

Constants

Bits

pub const Bits: uint = 512u;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 64u;

The number of bytes in the representation.

Source

Min

pub const Min: int512 = …;

The smallest representable value.

Source

Max

pub const Max: int512 = …;

The largest representable value.

Source

uint

extend uint

A target pointer-sized unsigned integer.

Source

Constants

Bits

pub const Bits: uint = sizeof(uint) * 8u;

The target representation width in bits.

Source

Bytes

pub const Bytes: uint = sizeof(uint);

The target representation size in bytes.

Source

Min

pub const Min: uint = 0u;

The smallest representable value.

Source

Max

pub const Max: uint = ~0u;

The largest representable value.

Source

uint8

extend uint8

An unsigned integer in 8 bits.

Source

Constants

Bits

pub const Bits: uint = 8;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 1;

The number of bytes in the representation.

Source

Min

pub const Min: uint8 = 0;

The smallest representable value.

Source

Max

pub const Max: uint8 = 255;

The largest representable value.

Source

uint16

extend uint16

An unsigned integer in 16 bits.

Source

Constants

Bits

pub const Bits: uint = 16;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 2;

The number of bytes in the representation.

Source

Min

pub const Min: uint16 = 0;

The smallest representable value.

Source

Max

pub const Max: uint16 = 65535;

The largest representable value.

Source

uint32

extend uint32

An unsigned integer in 32 bits.

Source

Constants

Bits

pub const Bits: uint = 32;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 4;

The number of bytes in the representation.

Source

Min

pub const Min: uint32 = 0;

The smallest representable value.

Source

Max

pub const Max: uint32 = 4294967295;

The largest representable value.

Source

uint64

extend uint64

An unsigned integer in 64 bits.

Source

Constants

Bits

pub const Bits: uint = 64;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 8;

The number of bytes in the representation.

Source

Min

pub const Min: uint64 = 0;

The smallest representable value.

Source

Max

pub const Max: uint64 = 18446744073709551615;

The largest representable value.

Source

uint128

extend uint128

An unsigned integer in 128 bits.

Source

Constants

Bits

pub const Bits: uint = 128u;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 16u;

The number of bytes in the representation.

Source

Min

pub const Min: uint128 = 0u128;

The smallest representable value.

Source

Max

pub const Max: uint128 = 340282366920938463463374607431768211455u128;

The largest representable value.

Source

uint256

extend uint256

An unsigned integer in 256 bits.

Source

Constants

Bits

pub const Bits: uint = 256u;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 32u;

The number of bytes in the representation.

Source

Min

pub const Min: uint256 = 0u256;

The smallest representable value.

Source

Max

pub const Max: uint256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935u256;

The largest representable value.

Source

uint512

extend uint512

An unsigned integer in 512 bits.

Source

Constants

Bits

pub const Bits: uint = 512u;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 64u;

The number of bytes in the representation.

Source

Min

pub const Min: uint512 = 0u512;

The smallest representable value.

Source

Max

pub const Max: uint512 = …;

The largest representable value.

Source