Multiplication of 2 positive numbers gives a negative product

The widen function can be used to generically convert to a wide enough type to store all possible arithmetic results. Ie widen(a) * widen(b).

8 Likes