detecting multiplication of uint64_t integers overflow with C

前端 未结 5 1161
天涯浪人
天涯浪人 2021-02-07 08:11

Is there any efficient and portable way to check when multiplication operations with int64_t or uint64_t operands overflow in C?

For instance, for addition of uint64_t I

5条回答
  •  孤独总比滥情好
    2021-02-07 08:48

    Related question with some (hopefully) useful answers: Best way to detect integer overflow in C/C++. Plus it not covers uint64_t only ;)

提交回复
热议问题