N'th: Difference between revisions
m
Corrected Forth code to produce 1011th, 1012th,1013th instead of 1011st, 1012nd, 1013rd
m (Corrected Forth code to produce 1011th, 1012th,1013th instead of 1011st, 1012nd, 1013rd) |
|||
Line 1,825:
<syntaxhighlight lang="forth">: 'nth ( -- c-addr ) s" th st nd rd th th th th th th " drop ;
: .nth ( n -- )
dup 100 mod 10 20 within if 0 .r ." th " exit then
dup 0 .r 10 mod 3 * 'nth + 3 type ;
Line 1,849:
1000th 1001st 1002nd 1003rd 1004th
1005th 1006th 1007th 1008th 1009th
1010th
1015th 1016th 1017th 1018th 1019th
1020th 1021st 1022nd 1023rd 1024th
=={{header|Fortran}}==
|