イフコンピュータ > MINERVA > マニュアル > レファレンス > 述語 > アトム項処理 > number_chars/2

number_chars/2

MINERVA
ifcomputer logo
f
Expert Services on the Web

数とその数をつくっている、1文字アトムのリストを関係づける。

number_chars(+数, -リスト)
number_chars(-数, +リスト)

もし、が数で、リスト が変数ならば、リスト は、のテキスト表現の文字列に対応する要素で構成される、1文字アトムのリストで単一化される。
もし、が変数ならば、リスト は1文字アトムのリストでなければならない。この1文字アトムの連結されたものは、数として解析可能なものでなければならない。は、その結果の数で単一化される。

引数

数                      数
リスト                  字リスト (長さ=1のアトム)

number_chars(1234, L). L <- ['1', '2', '3', '4'] の代入で、成功。
number_chars(N, ['2', '7', '.', '1', '1']). N <- 27.11 の代入で、成功。
number_chars(14.3, ['1', X, '.', Y]). X <- 4, Y <- 3 の代入で、成功。

標準

この述語は、ISO-Prolog標準に含まれる。

関連

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.

document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/atomic_term/number_chars/print_jp.html
published 2008/11/17 update 1998/8/11 (c) 1996-2006 IF Computer Japan
IF Computer 〒113-0022 Tel 03-5814-3352 start (AT) ifcomputer.com
Customer Support 東京都文京区千駄木5-28-2   http://www.ifcomputer.co.jp
戻る> managed with ubiCMS