BaseN (python module)

About

This is python module that treats notation system of base n.
You can define the Numeral system by the base(radix) or digits(numerals).

This was made referring to Math::BaseCalc(Perl module).

Documents

Manual

Usage sample

>>> from basen import *

>>> b = BaseN(2)
>>> b.str(2)
'10'
>>> b.int('10')
2
>>> b.float('-10.1')
-2.5

>>> b = BaseN(digits='._', point=':', negative_sign='>')
>>> b.str(2)
'_.'
>>> b.int('_.')
2
>>> b.float('>_.:_')
-2.5

Download

PyPI
basen-0.1.py