roman-literals
roman-literals
provides an easy way to write integer literals using Roman
numerals.
roman!
] macroType aliases like [iXXXII
] are provided to replace primitive types like
[i32
].
Using the [roman!
] macro, the type of the literal is automatically
inferred, with [iXXXII
] being the default. The macro also supports
negative numbers; see [roman!
] for more details.
Constants are also provided, such as [III_uXXXII
]. These constants are
all suffixed with their type.
```rust use roman_literals::*;
let fortytwo: uXXXII = roman!(XLII); asserteq!(forty_two, 42);
let negative3999: iXVI = roman!(-MMMCMXCIX); asserteq!(negative_3999, -3999);
let negative300 = -CCCiLXIV; // i64 asserteq!(negative300, -300); ```
Why not?