Skip to Content
i documentation
Standard library referenceModules

i/bits

Integer segments of bit arrays (§8.3, §8.4) that do not fit 63 bits. The runtime reads and writes narrower segments itself, with its fixed width primitives, and calls these functions for the others.

A segment of width bits holds its value in two’s complement. Big endian puts the most significant bit first. Little endian puts the groups of 8 bits least significant group first, each group most significant bit first; the last group may be shorter.

The two private primitives read and write at most 14 bits, big endian. They are not part of the language (§13).

read_int

The Int in the width bits of bits at start.

read_int = (

from_int

The width low bits of value, in two’s complement.

from_int = (value : Int, width : Int, little : Bool) -> BitArray {

On this page