Skip to content

Commit

Permalink
0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
librasteve committed Jun 21, 2024
1 parent cc342ab commit f90ccb0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
lib/.precomp
.precomp
.DS_Store
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Revision history for Slang::Roman

{{$NEXT}}

0.6.1 2024-06-21T15:03:02+01:00
- Move README to POD6

0.6 2024-06-21T14:10:54+01:00
- Add reference section to README
- Implement reference section subtractive standard
Expand Down
2 changes: 1 addition & 1 deletion META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
],
"test-depends": [
],
"version": "0.6"
"version": "0.6.1"
}
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ REFERENCE

According to [Wikipedia](https://en.wikipedia.org/wiki/Roman_numerals), the standard form is:

| # | Thousands | Hundreds | Tens | Units |
|---|-----------|----------|------|-------|
| 1 | M | C | X | I |
| 2 | MM | CC | XX | II |
| 3 | MMM | CCC | XXX | III |
| 4 | | CD | XL | IV |
| 5 | | D | L | V |
| 6 | | DC | LX | VI |
| 7 | | DCC | LXX | VII |
| 8 | | DCCC | LXXX | VIII |
| 9 | | CM | XC | IX |
<table class="pod-table">
<thead><tr>
<th>#</th> <th>Thousands</th> <th>Hundreds</th> <th>Tens</th> <th>Units</th>
</tr></thead>
<tbody>
<tr> <td>1</td> <td>M</td> <td>C</td> <td>X</td> <td>I</td> </tr> <tr> <td>2</td> <td>MM</td> <td>CC</td> <td>XX</td> <td>II</td> </tr> <tr> <td>3</td> <td>MMM</td> <td>CCC</td> <td>XXX</td> <td>III</td> </tr> <tr> <td>4</td> <td></td> <td>CD</td> <td>XL</td> <td>IV</td> </tr> <tr> <td>5</td> <td></td> <td>D</td> <td>L</td> <td>V</td> </tr> <tr> <td>6</td> <td></td> <td>DC</td> <td>LX</td> <td>VI</td> </tr> <tr> <td>7</td> <td></td> <td>DCC</td> <td>LXX</td> <td>VII</td> </tr> <tr> <td>8</td> <td></td> <td>DCCC</td> <td>LXXX</td> <td>VIII</td> </tr> <tr> <td>9</td> <td></td> <td>CM</td> <td>XC</td> <td>IX</td> </tr>
</tbody>
</table>

The numerals for 4 (IV) and 9 (IX) are written using subtractive notation,where the smaller symbol (I) is subtracted from the larger one (V, or X), thus avoiding the clumsier IIII and VIIII. Subtractive notation is also used for 40 (XL), 90 (XC), 400 (CD) and 900 (CM). These are the only subtractive forms in standard use.

Expand All @@ -53,7 +50,7 @@ Source can be located at: https://github.com/raku-community-modules/Slang-Roman
COPYRIGHT AND LICENSE
=====================

Copyright 2016, 2018 Jeff Goff, 2020-2024 Raku Community
Copyright 2016, 2018 Jeff Goff, 2020-2023 Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

20 changes: 20 additions & 0 deletions lib/Slang/Roman.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,26 @@ Future enhancements will include expansions to printf/sprintf with a custom form
While it handles both additive and subtractive Roman numerals, it doesn't check that they're properly formatted. For instance 'IC' should be a compile-time error but instead it'll generate 101 as if nothing of consequence happened.
=head1 REFERENCE
According to L<Wikipedia|https://en.wikipedia.org/wiki/Roman_numerals>, the standard form is:
=begin table
| # | Thousands | Hundreds | Tens | Units |
|---|-----------|----------|------|-------|
| 1 | M | C | X | I |
| 2 | MM | CC | XX | II |
| 3 | MMM | CCC | XXX | III |
| 4 | | CD | XL | IV |
| 5 | | D | L | V |
| 6 | | DC | LX | VI |
| 7 | | DCC | LXX | VII |
| 8 | | DCCC | LXXX | VIII |
| 9 | | CM | XC | IX |
=end table
The numerals for 4 (IV) and 9 (IX) are written using subtractive notation,where the smaller symbol (I) is subtracted from the larger one (V, or X), thus avoiding the clumsier IIII and VIIII. Subtractive notation is also used for 40 (XL), 90 (XC), 400 (CD) and 900 (CM). These are the only subtractive forms in standard use.
=head1 AUTHOR
Jeff Goff (DrForr)
Expand Down

0 comments on commit f90ccb0

Please sign in to comment.