Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.
/ numeral-system-py Public archive

Convert from one numeric system to other in python

License

Notifications You must be signed in to change notification settings

zifter/numeral-system-py

Repository files navigation

License Release Supported versions Docs Code Coverage Build status Appveyor Build Status Travis CI Contact Blog

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

About

Convert from one numeric system to other in python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages