1math::roman(1.0) math::roman(1.0)
2
3
4
5______________________________________________________________________________
6
8 math::roman - Tools for creating and manipulating roman numerals
9
11 package require Tcl 8.3
12
13 package require math::roman ?1.0?
14
15 ::math::roman::toroman i
16
17 ::math::roman::tointeger r
18
19 ::math::roman::sort list
20
21 ::math::roman::expr args
22
23______________________________________________________________________________
24
26 ::math::roman is a pure-Tcl library for converting between integers and
27 roman numerals. It also provides utility functions for sorting and per‐
28 forming arithmetic on roman numerals.
29
30 This code was originally harvested from the Tcler's wiki at
31 http://wiki.tcl.tk/1823 and as such is free for any use for any pur‐
32 pose. Many thanks to the ingeneous folk who devised these clever rou‐
33 tines and generously contributed them to the Tcl community.
34
35 While written and tested under Tcl 8.3, I expect this library will work
36 under all 8.x versions of Tcl.
37
39 ::math::roman::toroman i
40 Convert an integer to roman numerals. The result is always in
41 upper case. The value zero is converted to an empty string.
42
43 ::math::roman::tointeger r
44 Convert a roman numeral into an integer.
45
46 ::math::roman::sort list
47 Sort a list of roman numerals from smallest to largest.
48
49 ::math::roman::expr args
50 Evaluate an expression where the operands are all roman numer‐
51 als.
52
53 Of these commands both toroman and tointeger are exported for easier
54 use. The other two are not, as they could interfer or be confused with
55 existing Tcl commands.
56
58 This document, and the package it describes, will undoubtedly contain
59 bugs and other problems. Please report such in the category math ::
60 roman of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist].
61 Please also report any ideas for enhancements you may have for either
62 package and/or documentation.
63
64 When proposing code changes, please provide unified diffs, i.e the out‐
65 put of diff -u.
66
67 Note further that attachments are strongly preferred over inlined
68 patches. Attachments can be made by going to the Edit form of the
69 ticket immediately after its creation, and then using the left-most
70 button in the secondary navigation bar.
71
73 conversion, integer, roman numeral
74
76 Mathematics
77
79 Copyright (c) 2005 Kenneth Green <kenneth.green@gmail.com>
80
81
82
83
84Tcl Math Library tcllib math::roman(1.0)