Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

best_prefix() returns MiB for Bit rather than Mib #95

Open
rohit04saluja opened this issue Jan 9, 2021 · 1 comment
Open

best_prefix() returns MiB for Bit rather than Mib #95

rohit04saluja opened this issue Jan 9, 2021 · 1 comment

Comments

@rohit04saluja
Copy link

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

@rohit04saluja
Copy link
Author

@tbielawa any thoughts about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant