[ Type Testing | Reference Manual | Alphabetic 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) :- float(X).
       number(X) :- breal(X).

### Modes and Determinism

- number(?) is semidet

### Fail Conditions

Fails if Number is not a number

## 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, breal / 1, rational / 1, float / 1, real / 1