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 SF Trackers [http://source‐
61 forge.net/tracker/?group_id=12883]. Please also report any ideas for
62 enhancements you may have for either package and/or documentation.
63
65 conversion, integer, roman numeral
66
68 Copyright (c) 2005 Kenneth Green <kenneth.green@gmail.com>
69
70
71
72
73Tcl Math Library math math::roman(1.0)