3 ms·
I agree, it seems fishy to me that saturation rather than wrap is the integer overflow behavior in these systems.
by KaeseEs 16y ago
I agree, it seems fishy to me that saturation rather than wrap is the integer overflow behavior in these systems.
- dfox 16y agoSaturation is standard behavior of C's atoi() and friends. Over/underflow is signalled by returning largest/smallest possible value and setting errno to ERANGE. Many applications dont check for this (as it is not exactly straightforward) and thus get saturation.
- mattmillr 16y agoMySQL does this too. I once found a bunch of Facebook User IDs that were all 2147483647 after someone missed the memo that Facebook was transitioning to BigInts.