4 ms·
But I was told my C++ code could be hundreds of milliseconds faster if I ignore such checks...
by ChrisSD 8y ago
But I was told my C++ code could be hundreds of milliseconds faster if I ignore such checks...
- klodolph 8y agoIn this case, the crash occurred because the overflow error threw an exception, which the software was not prepared to handle. If the overflow check had been omitted the rocket would have launched successfully. (Not making a statement about what should have been done, here.)
- Retric 8y agorocket would have launched successfully That does not actually follow. It would not have crashed due to this specific issue, but it might have crashed from some other issue.
- klodolph 8y agoI was assuming that people were smart enough to figure that part out on their own, but thanks for connecting the dots for us, I guess.
- Gibbon1 8y ago30 years ago read an article in a dead tree magazine by a firmware engineer. He mentioned clipping and flagging over and underflows. His example was sqrt(small negative number) better to return zero and set a flag than to blow up. Because small negative number is most likely 'nominal zero'