3 ms·
That's nothing. Signed overflow in C/C++ is _undefined behavior_. Which means there's no guarantee that you'll get anything recognizable out of it. :-)
by m0zg 7y ago
That's nothing. Signed overflow in C/C++ is _undefined behavior_. Which means there's no guarantee that you'll get anything recognizable out of it. :-)
- ohazi 7y agoBut unsigned overflow is defined. Are we expecting a negative number of axles?
- m0zg 7y agoThe train counter isn't even software based. I just wanted to point out the example of a much more common issue that most programmers aren't aware of. Very few languages catch unsigned integer overflow as well. The only popular one I can name is Swift.