relates a number and the list of the one-character atoms forming that number. ...
Move to
Next Prev
Up Top
See also
atom_chars/2
atom_codes/2
atom_concat/3
atom_concat/2
atom_length/2
atom_number/2
atom_lower/2
atom_upper/2
char_code/2
number_chars/2
number_codes/2
parse_atom/2/3
sub_atom/5
write_atom/2
writeq_atom/2
IF Computer > MINERVA > Manual > Reference > Predicates > Atomic term processing > number_chars/2

number_chars/2

relates a number and the list of the one-character atoms forming that number.

number_chars(+Number, -List)
number_chars(-Number, +List)

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.

Arguments

Number                 number
List                   list of characters (atoms with length=1)

Examples

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

Standard

This predicate is part of the ISO-Prolog Standard.

See also

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.

read on...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Language
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/atomic_term/number_chars/home_en.html
published 2012/2/6 update 1998/8/11 (c) 1996-2009 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS