relates a number and the list of the one-character atoms forming that number.
If Number is a number and List is a variable then List
will be unified with the list of one-character atoms
whose elements correspond to
the sequence of characters of the textual representation of Number.
If Number is a variable then List must be a list of
one-character atoms. The concatenation of these one-character atoms must
be parsable as number. Number will be unified with the resulting number.
Number number List list of characters (atoms with length=1)
| number_chars(1234, L). | Succeeds with substitution L <- ['1', '2', '3', '4'] |
| number_chars(N, ['2', '7', '.', '1', '1']). | Succeeds with substitution N <- 27.11 |
| number_chars(14.3, ['1', X, '.', Y]). | Succeeds with substitution X <- 4, Y <- 3 |
This predicate is part of the ISO-Prolog Standard.
atom_chars/2, atom_codes/2, atom_concat/3, atom_length/2, atom_number/2, char_code/2, number_codes/2, parse_atom/2/3, sub_atom/5.