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

Some exotic float codes representing negative zero converted to positive zero. #333

Closed
scott-griffiths opened this issue May 17, 2024 · 0 comments

Comments

@scott-griffiths
Copy link
Owner

Of course positive and negative zero are equal, but for types that support them both the bit representations obviously aren't

Here we set a to be the representation for -0.0 in a 6-bit MXFP format, then convert it to a Python float and back again. It should survive the round trip but doesn't:

>>> a = bitstring.BitArray('0b100000')
>>> a.e3m2mxfp = a.e3m2mxfp
>>> a
BitArray('0b000000')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant