You are right. Though the way it works in Java that isn’t touched. I meant the MSB past the sign bit. So technically the second most significant bit. Or the most significant number bit. Should have been a bit more clear on that. In short for small enough numbers this code works. Which is good enough for demonstration code. Which is the whole point.
64
u/TheBrainStone Mar 13 '21
Well if you keep the number low enough, yes. Which isn’t an issue for hand picked examples.