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')
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: