Handbook
Glossary
>roman ( n -- str )
Roman numerals
Prev:
ROMAN:
Next:
>ROMAN ( n -- str )
Vocabulary
roman
Inputs
n
an
integer
Outputs
str
a
string
Word description
Converts a number to its lower-case Roman Numeral equivalent.
Notes
The range for this word is 1-3999, inclusive.
Examples
USING: io roman ; 56 >roman print
lvi
See also
>ROMAN
,
roman>
Definition
USING:
kernel
math
roman.private
sequences
;
IN:
roman
:
>roman
( n -- str )
roman-range-check
roman-values
roman-digits
[
[
/mod
swap
]
dip
<repetition>
concat
]
2map
""
concat-as
nip
;