2 ms·
Causing an interrupt is much more expensive than having a jump that won't be taken most of the time
by raverbashing 6y ago
Causing an interrupt is much more expensive than having a jump that won't be taken most of the time
- deleted 6y ago[deleted]
- rightbyte 6y agoUsually you don't really care that much about the overflow cost if it is an error right?
- raverbashing 6y agoTrue but do you care for all sums/muls in your code? Might be better to check where exactly can you have the overflows and test in the code for those cases. I think checking for overflows over the entire code is useful for testing/validation purposes but not really useful in production. Or use bigger data types if you're hitting overflows frequently.
- chrisseaton 6y ago> Might be better to check where exactly can you have the overflows and test in the code for those cases. Compilers already track possible ranges and do this.