To avoid overflow in addition operations, if all operands are positive integers and the ranges are known, during computation you can attempt to use uint32_t or uint64_t to prevent overflow
uint32_t
uint64_t