romanUnits
[]struct{...}romanUnits is the greedy subtractive-notation table, largest value first.
- OID
- 0eb46e…ba76:4
romanUnits details
ToRoman
func(n int) stringToRoman renders an integer in 1..3999 as a Roman numeral. It panics if n is out of range.
- OID
- 0eb46e…ba76:18
ToRoman details
FromRoman
func(s string) intFromRoman parses a Roman numeral back to an integer. It panics on any malformed input (e.g. "IIII", "IC", "VV").
- OID
- 0eb46e…ba76:20
FromRoman details
charVal
func(c uint8) intcharVal maps a single Roman digit to its value, or 0 if unknown.
- OID
- 0eb46e…ba76:21
charVal details
parseRoman
func(s string) (int, bool)parseRoman is the pure, panic-free core used by FromRoman and Render. It returns (value, true) only for a canonical numeral: it accepts input iff ToRoman(value) reproduces it exactly, which rejects malformed forms.
- OID
- 0eb46e…ba76:22
parseRoman details
examples
[]intexamples are the classic milestones shown by the root Render.
- OID
- 0eb46e…ba76:24
examples details
Render
func(path string) stringRender drives gnoweb: - "" or "/" → a table of example conversions - "/\<n>" → integer → Roman - "/r/\<roman>" → Roman → integer
- OID
- 0eb46e…ba76:25
Render details
renderToRoman
func(arg string) string- OID
- 0eb46e…ba76:26
renderToRoman details
renderFromRoman
func(arg string) string- OID
- 0eb46e…ba76:27
renderFromRoman details
renderTable
func() string- OID
- 0eb46e…ba76:28
renderTable details
usage
func() string- OID
- 0eb46e…ba76:29