bitmath
bitmath copied to clipboard
best_prefix() returns MiB for Bit rather than Mib
The best_prefix
of a bit unit comes as MegaByte. b -> M
How to REPRODUCE the issue:
>>> import bitmath
>>> b = bitmath.Bit(30950093.15655963)
>>> b
Bit(30950093.15655963)
>>> b.best_prefix()
MiB(3.6895386167239703)
>>>
How REPRODUCIBLE (every time? intermittently? only in certain environments?): Happens every time.
What you EXPECTED to happen:
The expectation was the best_prefix()
should have returned Mib
as the initial unit is in Bit
.
>>> b.to_Mib()
Mib(29.516308933791763)
>>>
What ACTUALLY happened:
best_prefix()
returned MiB
>>> b.best_prefix()
MiB(3.6895386167239703)
>>>
VERSION of bitmath effected (git hashes are OK). Did you install from RPM, PyPi, source?
- Version: 1.3.3.1
- Install Source: PyPi
Your OPERATING SYSTEM and the affected PYTHON VERSION:
Python: 3.7.3 OS: Linux 5.4.79-v7+ armv7l GNU/Linux