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 for negative values #55

Closed
mb4e opened this Issue Jan 5, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@mb4e
Copy link

mb4e commented Jan 5, 2016

The result of best_practive is always in Bits for negative values. It might be interesting to work on the absolute values, to get a more human readable result. Thanks for your work.

@tbielawa

This comment has been minimized.

Copy link
Owner

tbielawa commented Jan 5, 2016

Can you give me an example so i can understand better and reproduce what
you're describing please?

Thanks!
On Jan 5, 2016 2:09 PM, "mbdm" notifications@github.com wrote:

The result of best_practive is always in Bits for negative values It might
be interesting to work on the absolute values, to get a more human readable
result Thanks for your work


Reply to this email directly or view it on GitHub
#55.

@mb4e

This comment has been minimized.

Copy link

mb4e commented Jan 5, 2016

Ok, here is an example.

>>> bitmath.best_prefix(10**8)
MiB(95.367431640625)
>>> bitmath.best_prefix(-10**8)
Bit(-800000000.0)

The following result might be more readable.

>>> bitmath.best_prefix(10**8)
MiB(95.367431640625)
>>> bitmath.best_prefix(-10**8)
MiB(-95.367431640625)
@tbielawa

This comment has been minimized.

Copy link
Owner

tbielawa commented Jan 5, 2016

Oh wow! Yeah. That's a bug actually, the way i see it. I'll prioritize this
and get working on a fix.

Thank you for contributing to open source! :-)
On Jan 5, 2016 2:36 PM, "mbdm" notifications@github.com wrote:

Ok, here is an example.

bitmath.best_prefix(108)
MiB(95.367431640625)
bitmath.best_prefix(-10
8)
Bit(-800000000.0)

The following result might be more readable.

bitmath.best_prefix(108)
MiB(95.367431640625)
bitmath.best_prefix(-10
8)
MiB(-95.367431640625)


Reply to this email directly or view it on GitHub
#55 (comment).

@mb4e

This comment has been minimized.

Copy link

mb4e commented Jan 5, 2016

Great. Thank you again. ;)

@tbielawa tbielawa added the bug label Jan 5, 2016

@tbielawa tbielawa self-assigned this Jan 5, 2016

@tbielawa

This comment has been minimized.

Copy link
Owner

tbielawa commented Jan 7, 2016

@mbdm I've got a fix prepared and I'm going to push it up in a minute. I'll update this ticket again once I push an updated release to PyPi

@tbielawa tbielawa closed this in 3d98a89 Jan 7, 2016

tbielawa added a commit that referenced this issue Jan 8, 2016

@mb4e

This comment has been minimized.

Copy link

mb4e commented Jan 9, 2016

Thanks. New release on PyPi works fine. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment