3 ms·
I agree, Overflow is useful and it reflects how the hardware works, so its not something you want to emulate with modulo. The mistake of the C standard was not
by quelsolaar 9y ago
I agree, Overflow is useful and it reflects how the hardware works, so its not something you want to emulate with modulo.
The mistake of the C standard was not having it "Platform dependent", rather then "Undefined". The difference is a big deal. Since overflow is undefined the optimizer is allowed to assume it never happens and therefor optimize away things, even though the behavior is defined on all CPUs known to man.
- gpderetta 9y agounsigned overflow is well defined in C.