math::roman(3tcl)
π math::roman β bestie edition π
okay so this is math::roman, straight out of the Tcl Math Library, and it's literally the cutest little thing: it turns numbers into roman numerals and back. no cap. ποΈβ¨
β¨ NAME β¨
math::roman β tools for creating and manipulating roman numerals πΊ
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require math::roman ?1.1?
::math::roman::toroman i
::math::roman::tointeger r
::math::roman::sort list
::math::roman::expr args
π¦ DESCRIPTION π¦
::math::roman is a pure-Tcl library for converting between integers and roman numerals. and not just that bestie, it also hands you utility functions for sorting and doing arithmetic on roman numerals. it's giving "i contain multitudes." π
this code was originally harvested from the Tcler's wiki over at http://wiki.tcl.tk/1823, and because of that it's free for any use for any purpose. many thanks to the ingenious folk who devised these clever routines and generously contributed them to the Tcl community π«Ά genuinely iconic of them.
and okay, it was written and tested under Tcl 8.3, but the author expects this library will work under all 8.x versions of Tcl. slay. π₯
π COMMANDS π
::math::roman::toroman i
Convert an integer to roman numerals. the result is always in upper case (loud and proud, periodt). and heads up: the value zero gets converted to an empty string β not "0", not "N", just vibes and nothingness. π³οΈβ¨
::math::roman::tointeger r
Convert a roman numeral into an integer. reverse uno card, played. π
::math::roman::sort list
Sort a list of roman numerals from smallest to largest. tidy. organized. main character energy. π
::math::roman::expr args
Evaluate an expression where the operands are all roman numerals. math but make it ancient. ποΈ
of these commands, both toroman and tointeger are exported for easier use. the other two are not exported, because they could interfer β or be confused with β existing Tcl commands. it's giving "they're shy, leave them alone." π
ngl, that's the whole reason. no hidden lore. just name-collision prevention bestie. π
π BUGS, IDEAS, FEEDBACK π
this document, and the package it describes, will undoubtedly contain bugs and other problems. it's a manpage, it's not that deep, but fr fr β please report such in the category math :: roman of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist.
please also report any ideas for enhancements you may have for either the package and/or the documentation. we love ideas. ideas are the moment. β¨
when proposing code changes, please provide unified diffs, i.e. the output of diff -u. π
note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. iykyk π―
π KEYWORDS π
conversion, integer, roman numeral
π CATEGORY π
Mathematics
π COPYRIGHT π
Copyright (c) 2005 Kenneth Green <kenneth.green@gmail.com>
and that's the whole page bestie!! this was tcllib version 1.1, dated math::roman(3tcl) β go forth and roman-numeral-ify everything. mwah π π¦β¨πΈππ
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2005 Kenneth Green <kenneth\&.green@gmail\&.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms