fixnum?(3scm) Scheme Programmer's Manual fixnum?(3scm)

fixnum? - test if an object is a fixnum

(import (rnrs))                     ;R6RS
(import (rnrs arithmetic fixnums))  ;R6RS

(fixnum? obj)

Returns #t if obj is an exact integer object within the fixnum range, #f otherwise.

The fixnum range is implementation-dependent, see fixnum-width(3scm).

Returns a single boolean object as per the description.

(fixnum? 0)            => #t
(fixnum? (expt 2 20))  => #t
(fixnum? #f)           => #f
(fixnum? "123")        => #f
(fixnum? (fx+ a 1))
    => #t or &implementation-restriction

This procedure can raise exceptions with the following condition types:
&assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain.
R7RS
The assertions described above are errors. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically.

fixnum-width(3scm)

R6RS

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

2021-01-17