2 ms·
>> the next target should be the enforcement of underflow/overflow trapping Trapping is nonsense - in production anyway. You might use it in development to cat
by phkahler 3y ago
>> the next target should be the enforcement of underflow/overflow trapping
Trapping is nonsense - in production anyway. You might use it in development to catch errors. But in production there is no way to "fix" an overflow if it happens and is detected, so you'd be looking to crash on trap which in some code is preferable to silent data corruption.
I do lots of fixed-point math for embedded motor control. Representing rotor angle as a signed 16bit number is deeply engrained in me these days because taking differences to get a signed delta just works, and I never have to worry about rollover because it behaves exactly the way I want. ;-) While this is technically undefined behavior, I've never run across a compiler that worked differently.