math::roman(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 (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