3 ms·
Keep in mind, of course, that the solution there is highly specific to Java. You need to know how your language of choice responds here. (Is `n >> 31` valid if
by deathanatos 13y ago
Keep in mind, of course, that the solution there is highly specific to Java. You need to know how your language of choice responds here. (Is `n >> 31` valid if n is negative? does it sign-extend? Is that guaranteed by the language, or your box? Are integers even 32 bits?)