13.4.153  tagged_int

The standard library tagged_int package implements 31-bit integer arithmetic on 32-bit architectures (and eventually 63-bit integer arithmetic on 64-bit architectures).

The major advantage of 31-bit integers over 32-bit integers in the Mythryl context is that typeagnostic lists, vectors etc. can store 31-bit integers in a single machine word (i.e., in pointer), using a one-bit tag to distinguish them from pointer values, whereas 32-bit integers must be stored in separate records at significant overhead in time and space. (This use of 31-bit tagged integers is very similar to what is done in traditional Lisp implementations.)

The tagged_int package implements the Int API.

The tagged_int package source code is in src/lib/std/tagged-int.pkg.

See also: tagged_unt.

See also: int.

See also: one_word_int.

See also: two_word_int.

See also: multiword_int.

The above information is manually maintained and may contain errors.


Comments and suggestions to: