Situation:
I've a system which reads a continuous stream of numbers (integers only).
- The numbers are both positive and negative.
- Some of the numbers are results of overflowed arithmetic operations: so these numbers will be negative ones in the stream.
Problem:
How can I differentiate between overflowed negative numbers and non-overflowed negative number in a stream? Is there a way to find and discard overflowed numbers? I'm developing in C# and don't have control over the stream source. So I can't change the code or add any checks.