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
Thanks for brining this up. Our Signed Big Integer implementation uses a sign bit and an unsigned magnitude. When we perform a right shift on a BigInt we basically just shift the magnitude right.
In contrast, right shifting Int is a right shift on the Two's complement representation of that integer, where the top most bits are filled with ones.
The behavior of a right shift of negative integers is in theory implementation dependent. Though I think it could be beneficial for the BigInt implementation to behave like the Swift Int implementation (and the majority of other implementations e.g. python, ...).
Signed bitwise shift doesn't work.
Example:
The text was updated successfully, but these errors were encountered: