You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That fails, because bitWidth returns 65. It's not correctly handling the cases of 0b1 followed by some number of 0b0's, because with two's complement the magnitude of your minimum value is one higher than of your maximum value. Doing magnitude.bitWidth + 1 fails to account for this.
The text was updated successfully, but these errors were encountered:
wadetregaskis
changed the title
bitWidth is wrong for -(power-of-two-plus-one)
bitWidth is wrong for -(power-of-two)
Oct 9, 2023
That fails, because bitWidth returns 65. It's not correctly handling the cases of 0b1 followed by some number of 0b0's, because with two's complement the magnitude of your minimum value is one higher than of your maximum value. Doing
magnitude.bitWidth + 1
fails to account for this.The text was updated successfully, but these errors were encountered: