we talked last week about what can go wrong with floating point numbers, so -- what can go wrong when using integers?

so far I have:

* 32 bit integers are smaller than you think (they only go up to 4 billion!)
* overflow
* sometimes you need to switch the byte order
* ?? (maybe something about shift / bitwise operations? not sure what can go wrong with that exactly)

I'd especially love real-world examples of things that have gone wrong, if you have them!

@b0rk problems/mistakes when casting (eg, truncation or signed/unsigned). not handling signed ints correctly when doing bit manipulation (eg, masking bits for truncation)
@bnewbold are there good reasons to do bit manipulation on signed integers? (what are they?)
@b0rk I think the more common issue is that one thinks they are manipulating an unsigned int, or assuming that a signed value is safely in positive range, but it isn't
@bnewbold yeah that makes sense. someone else mentioned that some language don’t have unsigned ints