math::roman(1.1)

๐Ÿ“ฆ
version 2.0 ยท 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

๐Ÿ’– math::roman โ€” bestie edition ๐Ÿ’–

okay so this is math::roman, version 1.1, and it's literally the cutest little Tcl library for doing roman numerals. like, actual XIV type stuff. 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, bestie. pure. no compiled extensions, no sneaky C, just vibes and Tcl. it converts back and forth between integers and roman numerals, and it also hands you utility functions for sorting roman numerals and doing arithmetic on them. it's giving ancient Rome but make it scriptable. ๐Ÿ‘‘

this code was originally harvested from the Tcler's wiki over at http://wiki.tcl.tk/1823, and as such it's free for any use for any purpose. huge thank you to the ingenious folk who came up with these clever routines and generously dropped them into the Tcl community โ€” absolute icons, we stan. ๐Ÿซถ

and yeah, it was written and tested under Tcl 8.3, but the expectation is that this library works under all 8.x versions of Tcl. so like, if you're on an old one, you're probably fine. ๐Ÿ’…


๐Ÿ”ฅ COMMANDS ๐Ÿ”ฅ

  • ::math::roman::toroman i โ€” converts an integer into roman numerals. the result is always upper case, periodt. and heads up: the value zero gets converted to an empty string. not "N", not "0", justโ€ฆ nothing. it's giving silence. ๐Ÿคซ
  • ::math::roman::tointeger r โ€” converts a roman numeral into an integer. that's it, that's the whole thing. โœจ
  • ::math::roman::sort list โ€” sorts a list of roman numerals from smallest to largest. because alphabetically sorting roman numerals is a whole lie, ngl.
  • ::math::roman::expr args โ€” evaluates an expression where all the operands are roman numerals. yes bestie, math but fancy. ๐Ÿงฎ

okay so out of these four, only toroman and tointeger are exported, so they're the easy ones to just call. the other two are not exported, because they could interfere with โ€” or get confused for โ€” existing Tcl commands. they said "we're not doing namespace crimes today." ๐Ÿ’€


๐Ÿ˜ญ BUGS, IDEAS, FEEDBACK ๐Ÿ˜ญ

this document, and the package it describes, will undoubtedly contain bugs and other problems. like, it's software, babe. please report them in the category math :: roman of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist.

also please report any ideas for enhancements you may have for either the package and/or the documentation. we love ideas. ๐Ÿซถ

when proposing code changes, please provide unified diffs, i.e. the output of diff -u. fr fr, that's the format.

note further that attachments are strongly preferred over inlined patches. you can make an attachment 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 Tcl Math Library, shipped as part of tcllib, for math::roman(1.1). go forth and convert integers with main character energy. slay. โœจ๐Ÿ‘‘๐ŸŒธ

๐Ÿ“ฆ where this page comes from