4 ms·
Sanitize your endpoint to ensure that both a and b are within INT_MIN/2 to INT_MAX/2. After all, you didn't pick INT_MIN; the entire point of a 32-bit integer
by geofft 9y ago
Sanitize your endpoint to ensure that both a and b are within INT_MIN/2 to INT_MAX/2.
After all, you didn't pick INT_MIN; the entire point of a 32-bit integer or a 64-bit integer is that it's more than enough for reasonable purposes. It's not based on a physical constant or anything, it's just convenient and large. If you need a specific number of bits for your purposes that's more than that, use a u128 extension or a bigint type.