Hacker News new | ask | show | jobs
by kazinator 846 days ago
Because the shift operations are arithmetically defined, and the situations that are undefined correspond to overflow. v << 1 means the same thing as v * 2 and is undefined if v * 2 is undefined.