Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

digit-char-p

digit-char-p

type: predicate function (subr) 
location: built-in
source file: xlstr.c 
Common LISP compatible: similar
versions: all machines

SYNTAX

(digit-char-p <char> )
        <char>          -       a character expression

DESCRIPTION

The DIGIT-CHAR-P predicate checks if the <char> expression is a numeric digit. If <char> is numeric digit a T is returned, otherwise a NIL is returned. Decimal digits are '0' (ASCII decimal value 48) through '9' (ASCII decimal value 57).

EXAMPLES

(digit-char-p #\0)                      ; returns T
(digit-char-p #\9)                      ; returns T
(digit-char-p #\A)                      ; returns NIL
(digit-char-p #\a)                      ; returns NIL
(digit-char-p #\.)                      ; returns NIL
(digit-char-p #\-)                      ; returns NIL
(digit-char-p #\+)                      ; returns NIL

NOTE: Other non-digit characters used in numbers are NOT included: plus (+), minus (-), exponent (e or E) and decimal point (.).

COMMON LISP COMPATIBILITY: Common LISP supports the use of an optional radix parameter. This option specifies numeric base. This allows the DIGIT-CHAR-P to function properly for hexadecimal digits (for example). Common LISP supports up to base 36 radix systems. XLISP does not support this radix parameter.


Go to the first, previous, next, last section, table of contents.