fixnums(7scm) Scheme Programmer's Manual fixnums(7scm)

fixnums - Fixnum arithmetic

(import (rnrs arithmetic fixnums))

Every implementation must define its fixnum range as a closed interval [−2^(w−1), 2^(w−1)−1] such that w is a (mathematical) integer w ≥ 24. Every mathematical integer within an implementation’s fixnum range must correspond to an exact integer object that is representable within the implementation. A fixnum is an exact integer object whose value lies within this fixnum range.

Fixnum operations perform integer arithmetic on their fixnum arguments, but raise an exception with condition type &implementation-restriction if the result is not a fixnum.

GNU Guile
Guile runs generic arithmetic faster than fixnums. If the numbers are of a certain width (e.g. 32-bit) then they should be to truncated with bitwise-and.
IronScheme
IronScheme stores fixnums on the heap. Remember to not use eq?, assq or memq on fixnums. (This applies to Scheme as such, not just IronScheme).

R6RS

fixnum-width(3scm)

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://weinholt.se/scheme/manpages/.
2020-04-18