11.3.135 number_chars/2 [ISO]

Synopsis

number_chars(+Number, -Chars)

number_chars(-Number, +Chars)

Chars is the chars comprising the printed representation of Number.

Arguments

Number
number
Chars
chars

Description

Initially, either Number must be instantiated to a number, or Chars must be instantiated to a proper chars (containing no variables).

If Number is initially instantiated to a number, Chars will be unified with the chars that make up its printed representation.

If Number is uninstantiated and Chars is initially instantiated to a chars that corresponds to the correct syntax of a number, Number will be bound to that number; otherwise number_chars/2 will simply fail.

Exceptions

instantiation_error
Number and Chars are both uninstantiated
type_error
Number is not a number or Chars is not a list, or Chars is not a chars
representation_error
Chars is a list corresponding to a number that can't be represented
syntax_error
Chars does not correspond to a syntactically valid number

See Also

number_codes/2.


Send feedback on this subject.