[ ECLiPSe Type Testing built-in.|Group Index| Full Index]

number(?Number)

Succeeds if Number is a number.

?Number
Prolog term.

Description

Used to test whether Number is a number. number/1 could be defined as

   number(X) :- integer(X).
   number(X) :- rational(X).
   number(X) :- real(X).

Fail Conditions

Fails if Number is not a number.

Resatisfiable

No.

Exceptions

Examples


   Success:
   number(10).
   number(-21.0).
   number(1_3).
   number(3e27).
   Fail:
   number(pi).
   number(e).
   number('-21.0').
   number(X).
   number(fred).


See Also

atomic / 1, integer / 1, rational / 1, real / 1