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).