Paste: Roman numerals
Author: | n |
Mode: | postscript |
Date: | Wed, 20 Jun 2012 11:54:50 |
Plain Text |
/divmod { 2 copy idiv 3 1 roll mod } bind def
/romnumz [ [ 1000 (m) ] [ 900 (cm) ] [ 500 (d) ] [ 400 (cd) ] [ 100 (c) ] [ 90 (xc) ] [ 50 (l) ] [ 40 (xl) ] [ 10 (x) ] [ 9 (ix) ] [ 5 (v) ] [ 4 (iv) ] [ 1 (i) ] ] def
/cvroman {
() exch
romnumz { aload pop
3 1 roll divmod
3 1 roll dup 0 gt
{ mark 3 1 roll
{ dup } repeat pop
counttomark 1 sub
{ conc } repeat
exch pop
exch 3 1 roll
conc exch
} { pop pop }
ifelse
} forall pop
} bind def
Author: | you |
Mode: | factor |
Date: | Tue, 27 Nov 2018 05:23:23 |
Plain Text |
4
New Annotation