mirror of
https://github.com/fschmnn/duodecimal.git
synced 2024-11-22 07:34:57 +00:00
Merge branch 'master' of https://github.com/fschmnn/duodecimal
This commit is contained in:
commit
0565422c49
15
README.md
15
README.md
@ -5,7 +5,7 @@ Python converter/calculator for the duodecimal numeral system (1,2,3,4,5,6,7,8,9
|
|||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
```python
|
```python
|
||||||
from duodecimal import duo
|
from duodecimal import duo, binary
|
||||||
```
|
```
|
||||||
A duodecimal number can be initialized by passing a duodecimal number as a string or a decimal number as an int/float
|
A duodecimal number can be initialized by passing a duodecimal number as a string or a decimal number as an int/float
|
||||||
```python
|
```python
|
||||||
@ -22,8 +22,19 @@ f = duo(20) / 'X'
|
|||||||
The decimal representation can be accessed via
|
The decimal representation can be accessed via
|
||||||
```python
|
```python
|
||||||
g = duo('X.31')
|
g = duo('X.31')
|
||||||
g.dec()
|
g.decimal()
|
||||||
|
g.value
|
||||||
```
|
```
|
||||||
|
Other bases are supported as well
|
||||||
|
```python
|
||||||
|
h = binary('1001')
|
||||||
|
i = h + g
|
||||||
|
```
|
||||||
|
`i` takes the base from the left argument. Comparisions are also possible
|
||||||
|
```python
|
||||||
|
binary('110011') <= duo('X1')
|
||||||
|
```
|
||||||
|
|
||||||
## Why base12?
|
## Why base12?
|
||||||
We use base10 because of the number of fingers we have and not because it is easy to use. While it might be handy for counting, it has serious disadvantages for arithmic operations. This is because 12 has more divisors and hence most sequences in the multiplication table are shorter
|
We use base10 because of the number of fingers we have and not because it is easy to use. While it might be handy for counting, it has serious disadvantages for arithmic operations. This is because 12 has more divisors and hence most sequences in the multiplication table are shorter
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user