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
* underflow
* signed and unsigned may act differently
* loss of precision if the order of operations decreases the number of bits in the the intermediate results
@gdinwiddie can you say more about "signed and unsigned may act differently"? (how?)

@b0rk @gdinwiddie say you write the following bound check:
if (x < length - 1) { ... }

If you are using usigned, and if legth is zero, then the bound check is busted. This is a common error, and is very likely to pass code review.