3 ms·
Well, there are builtin functions that do this safely for signed integers. Of course that means you need to be aware which calculations are potentially dangero
by revelation 11y ago
Well, there are builtin functions that do this safely for signed integers.
Of course that means you need to be aware which calculations are potentially dangerous, you need to know about signed integer overflow problems in the first place, etc. ..
- michaelhoffman 11y agoWhat functions are those?
- kevinnk 11y agoFor gcc see https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins...