The functions in this section test for numbers, or for a specific
type of number. The functions integerp and floatp can
take any type of Lisp object as argument (they would not be of much
use otherwise), but the zerop predicate requires a number as
its argument. See also integer-or-marker-p and
number-or-marker-p, in Predicates on Markers.
This predicate tests whether its argument is a floating point number and returns
tif so,nilotherwise.
floatpdoes not exist in Emacs versions 18 and earlier.
This predicate tests whether its argument is an integer, and returns
tif so,nilotherwise.
This predicate tests whether its argument is a number (either integer or floating point), and returns
tif so,nilotherwise.
The
wholenumppredicate (whose name comes from the phrase “whole-number-p”) tests to see whether its argument is a nonnegative integer, and returnstif so,nilotherwise. 0 is considered non-negative.
This predicate tests whether its argument is zero, and returns
tif so,nilotherwise. The argument must be a number.
(zerop x)is equivalent to(= x 0).