math::roman(3tcl) 1.0 math "Tcl Math Library"

NAME

math::roman - Tools for creating and manipulating roman numerals

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    COMMANDS
    BUGS, IDEAS, FEEDBACK
    KEYWORDS
    COPYRIGHT

SYNOPSIS

package require Tcl 8.3
package require math::roman ?1.0?

::roman::toroman i
::roman::tointeger r
::roman::sort list
::roman::expr args

DESCRIPTION

math::roman is a pure-Tcl library for converting between integers and roman numerals. It also provides utility functions for sorting and performing arithmetic on roman numerals.

This code was originally harvested from the Tcler's wiki at http://wiki.tcl.tk/1823 and as such is free for any use for any purpose. Many thanks to the ingeneous folk who devised these clever routines and generously contributed them to the Tcl community.

While written and tested under Tcl 8.3, I expect this library will work under all 8.x versions of Tcl.

COMMANDS

::roman::toroman i
Convert an integer to roman numerals. The result is always in upper case. The value zero is converted to an empty string.

::roman::tointeger r
Convert a roman numeral into an integer.

::roman::sort list
Sort a list of roman nnumerals from smallest to largest.

::roman::expr args
Evaluate an expression where the operands are all roman numerals.

BUGS, IDEAS, FEEDBACK

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category math :: roman of the Tcllib SF Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

KEYWORDS

conversion, integer, roman numeral

COPYRIGHT

Copyright © 2005 Kenneth Green <kenneth.green@gmail.com>