Welcome to numeral-system-py’s documentation!¶
numeral-system-py¶
Convert from one numeric system to other in python.
Supports following:
roman numerals
positional numerals (like binary, arabic (decimal), hexadecimal and others)
Example of usage¶
Roman¶
>>> import numeral_system
>>> numeral_system.roman.encode(7)
'VII'
>>> numeral_system.roman.decode('XXII')
22
Positional¶
>>> import numeral_system
>>> numeral_system.positional.encode(42, 2)
'101010'
>>> numeral_system.positional.encode(12, 3)
'110'
>>> numeral_system.positional.decode(101, 2)
5
>>> numeral_system.positional.decode('AF', 16)
175