6.24.1 Simple numeric output

The simplest output functions are those that display integers from the data stack. Numbers are displayed in the base (aka radix) stored in base (see Base and integer decimal point). For outputting integers with additional formatting requirements see Integer to string conversion.

. ( n –  ) core “dot”

Display (the signed single number) n in free-format, followed by a space.

dec. ( n –  ) gforth-0.2 “dec-dot”

Display n as a signed decimal number, followed by a space.

h. ( u –  ) gforth-1.0 “h-dot”

Display u as an unsigned hex number, prefixed with a "$" and followed by a space.

hex. ( u –  ) gforth-0.2 “hex-dot”

Display u as an unsigned hex number, prefixed with a $ and followed by a space. Another name for this word is h., which is present in several other systems, but not in Gforth before 1.0.

u. ( u –  ) core “u-dot”

Display (the unsigned single number) u in free-format, followed by a space.

.r ( n1 n2 –  ) core-ext “dot-r”

Display n1 right-aligned in a field n2 characters wide. If more than n2 characters are needed to display the number, all digits and, if necessary, the sign “-”, are displayed.

u.r ( u n –  ) core-ext “u-dot-r”

Display u right-aligned in a field n characters wide. If more than n characters are needed to display the number, all digits are displayed.

dec.r ( u n –  ) gforth-0.5 “dec-dot-r”

Display u as a unsigned decimal number in a field n characters wide.

d. ( d –  ) double “d-dot”

Display (the signed double number) d in free-format. followed by a space.

ud. ( ud –  ) gforth-0.2 “u-d-dot”

Display (the signed double number) ud in free-format, followed by a space.

d.r ( d n –  ) double “d-dot-r”

Display d right-aligned in a field n characters wide. If more than n characters are needed to display the number, all digits and, if necessary, the sign “-”, are displayed.

ud.r ( ud n –  ) gforth-0.2 “u-d-dot-r”

Display ud right-aligned in a field n characters wide. If more than n characters are needed to display the number, all digits are displayed.