Python converter/calculator for the duodecimal numeral system
Go to file
2019-03-09 13:00:59 +01:00
.gitignore
duodecimal.py 2019.03.09 - format method and X, E in multiplication table 2019-03-09 12:25:36 +01:00
example_usage.ipynb 2019.03.09 - format method and X, E in multiplication table 2019-03-09 12:25:36 +01:00
README.md 2019.03.09 - create readme 2019-03-09 13:00:59 +01:00

duodecimal

Python converter/calculator for the duodecimal numeral system

from duodecimal import duo

A duodecimal number can be initialized by passing a duodecimal number as a string or a decimal number as an int/float

a = duo('1X.23')  # initialize with duodecimal value
b = duo(3.14)     # initialize with decimal value

All basic math operations are supported. The first part must be an instance of the duo class. The second one can be another instance or any valid input for the duo class

c = a + b
d = a - 2
e = b * duo(1/2)
f = duo(20) / 'X'

The decimal representation can be accessed via

g = duo('X.31)
g.dec()