https://github.com/harryscholes/romannumerals.jl
Roman numeral arithmetic
https://github.com/harryscholes/romannumerals.jl
julia roman-number roman-number-converter roman-numeral roman-numerals
Last synced: 15 days ago
JSON representation
Roman numeral arithmetic
- Host: GitHub
- URL: https://github.com/harryscholes/romannumerals.jl
- Owner: harryscholes
- License: mit
- Created: 2019-03-06T09:10:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-26T19:50:38.000Z (over 5 years ago)
- Last Synced: 2025-10-09T02:03:49.604Z (15 days ago)
- Topics: julia, roman-number, roman-number-converter, roman-numeral, roman-numerals
- Language: Julia
- Homepage:
- Size: 27.3 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RomanNumerals.jl
[](https://harryscholes.github.io/RomanNumerals.jl/stable)
[](https://harryscholes.github.io/RomanNumerals.jl/dev)
[](https://travis-ci.com/harryscholes/RomanNumerals.jl)
[](https://codecov.io/gh/harryscholes/RomanNumerals.jl)
[](https://coveralls.io/github/harryscholes/RomanNumerals.jl?branch=master)
Julia package for Roman numerals.
# Installation
```julia
] add https://github.com/harryscholes/RomanNumerals.jl
```
# Examples
```julia
julia> using RomanNumerals
julia> foreach(i->println(RomanNumeral(i)), 1:5)
I
II
III
IV
V
julia> I + I
II
julia> V - I
IV
julia> 3X - 2I
XXVIII
julia> M ÷ X
C
julia> rand(RomanNumeral, 5)
5-element Array{RomanNumeral,1}:
LXXI
CXX
XCVIII
XLIX
VIII
julia> RomanNumeral(2019)
MMXIX
julia> Int16(rn"MMXIX")
2019
julia> rn"I" == RomanNumeral("I") == RomanNumeral('I') == RomanNumeral(1)
true
```