atom/1
Module: builtins
atom/1
— the term is an atom
atomic/1
— the term is an atom or a number
float/1
— the term is a floating point number
integer/1
— the term is an integer
number/1
— the term is an integer or a floating point
FORMS
atom(Term)
atomic(Term)
float(Term)
integer(Term)
number(Term)
DESCRIPTION
Each of these predicates will succeed when its argument is of the proper type, and fail otherwise. integer/1
and float/1
examine the only the representation of a number. For instance, the call integer(2)
will succeed because 2
is represented internally as an integer. In addition, float(4294967296)
will succeed because 4294967296
is represented by a floating point value since it is outside the range of the integer representation.
EXAMPLES
The following are examples of the use of the type predicates :
?- atom(bomb).
yes.
?- integer(2001).
yes.
?- float(cement).
no.