zero?, flzero?, fxzero? - test if a number is zero
(import (rnrs)) ;R6RS
(import (rnrs base)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
(import (rnrs arithmetic flonums)) ;R6RS
(import (rnrs arithmetic fixnums)) ;R6RS
Test whether the number object z is zero. This procedure works
on all number objects, up to and including complex numbers.
The flzero? variant is restricted to flonums and the
fxzero? variant is restricted to fixnums.
Returns #t if the number is zero, otherwise #f.
(zero? 0) => #t
(zero? 0.0) => #t
(zero? 0.0+0.0i) => #t
(zero? -1) => #f
(zero? 1/2) => #f
(fxzero? 0) => #t
(flzero? 0.0) => #t
(fxzero? 1/2) => &assertion
(flzero? 1/2) => &assertion
Used as a shorthand for (= x 0). Use with higher-order functions
The description is the same in all Scheme reports. Compatibility will
depend on general factors that affect the number system, such as
implementation support for complex numbers and IEEE 754 floating
The restricted procedures are only specified in R6RS.
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.
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.
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
This procedure should normally not be used on inexact numbers since
inaccuracies in computations makes its use unreliable.
Markup created by unroff 1.0sc, March 04, 2023.