Heteroclinic.net logo


Safe Integer Addition Analysis
For the addition of two integers a and b, we know how to safely predict an overflow instance. For two integers addition, the carry will be exactly 1, the remainder is a- (M - b + 1), for a >= b > 0; if b is 0, there won't be overflow.

Safe Integer Addition Coding Experiment
Experimenting safe addition:

Safe Integer Multiplication Analysis
Given M >= a >= b > 0, for b =0, no overflow will happen.

Safe Integer Multiplication Coding Experiment
Experimenting safe multiplication:

We found engineering is hard. It is not a soft target.
We also found how fatal the least significant digit(s) plays in deciding the prime or composite attribute of a very large number.