# Integer versus fixnum

**URL:** <https://racket.discourse.group/t/integer-versus-fixnum/4223>\
**Category:** General\
**Tags:** question\
**Created:** [May 20, 2026, 10:23pm UTC](https://racket.discourse.group/t/integer-versus-fixnum/4223 "2026-05-20T22:23:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MickeyKnox](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@MickeyKnox](https://racket.discourse.group/u/MickeyKnox)\
**Post date:** [May 20, 2026, 10:23pm UTC](https://racket.discourse.group/t/integer-versus-fixnum/4223/1 "2026-05-20T22:23:31Z")

</div>

What is the difference between a integer and a fixnum?

More specifically, is there an example for a number, that has different results for `exact-integer?` and `fixnum?`?

---

<div class="post-metadata">

**Author:** ![EmEf](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@EmEf](https://racket.discourse.group/u/EmEf)\
**Post date:** [May 20, 2026, 10:48pm UTC](https://racket.discourse.group/t/integer-versus-fixnum/4223/2 "2026-05-20T22:48:31Z")

</div>

Does this help:

```scheme
#lang racket

(define (! n) (if (zero? n) 1 (* n (! (sub1 n)))))

(define 100! (! 100))

(fixnum? 100!)

(exact-integer? 100!)

```

---

<div class="post-metadata">

**Author:** ![ndykman](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/ndykman/32/2140_2.png) [@ndykman](https://racket.discourse.group/u/ndykman)\
**Post date:** [May 20, 2026, 10:48pm UTC](https://racket.discourse.group/t/integer-versus-fixnum/4223/3 "2026-05-20T22:48:32Z")

</div>

A `fixnum` fits within the architecture-specific (32 or 64) bit size. An `integer` can be any size.

```scheme
(exact-integer? 23525259203202342952593259256823482349025830975209532095702957)
(fixnum? 23525259203202342952593259256823482349025830975209532095702957)

```

These will return different values.

---

<div class="post-metadata">

**Author:** ![LiberalArtist](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/liberalartist/32/151_2.png) [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)\
**Post date:** [May 21, 2026, 1:13am UTC](https://racket.discourse.group/t/integer-versus-fixnum/4223/4 "2026-05-21T01:13:40Z")

</div>

> [@ndykman](#):
>
> A `fixnum` fits within the architecture-specific (32 or 64) bit size.

Even more specifically, the size of a fixnum depends on both the architecture and the Racket VM implementation: the maximum size will be _less_ than `(system-type 'word)`, as the VM will use at least one bit for tagging (and recall that one bit will be used for the sign).

On a specific system, fixnums are integers [from `(most-negative-fixnum)` to `(most-positive-fixnum)`](https://docs.racket-lang.org/reference/fixnums.html#%28part._fxrange%29), inclusive. You can get the maximum number of bits with [`(add1 (integer-length (most-positive-fixnum)))`](https://docs.racket-lang.org/reference/generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._integer-length%29%29) or [`(require (only-in rnrs fixnum-width))`](https://docs.racket-lang.org/r6rs/r6rs-lib-std/r6rs-lib-Z-H-12.html#node_idx_858). And [`fixnum-for-every-system?`](https://docs.racket-lang.org/reference/fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fixnum-for-every-system~3f%29%29) might also be of interest.

Currently, the sizes are (where CS is the normal, recommended Racket VM implementation):

| | 64 | 32\> |
| --- | --- | --- |
| CS | 61 | 30 |
| BC | 63 | 31 |
