Easton Man's Channel
7 days ago
Daniel Lemire's blog
Checking multiplication overflow
Telegraph
|
source
Telegraph
Checking multiplication overflow
Suppose that x is a variable of an unsigned type. In C/C++, it could be of type size_t for example. You have an expression like 6 * x and you want to know whether 6 * x overflows. That is, you want to know if 6 * x exceeds the range of values that can be…
Home
Powered by
BroadcastChannel
&
Sepia