3 ms·
Is there a difference, in this case? Addition can also overflow.
by csande17 3y ago
Is there a difference, in this case? Addition can also overflow.
- xarope 3y agonot as dramatically as mult can. and besides, if addition overflows, then it behooves you to ensure your next implementation doesn't, otherwise you are just adding technical debt.
- xxs 3y agoYes, I mentioned in a sibling answer - the mul overflows much easier and detecting is much harder, hence it uses two registers in the CPU for the result. Detecting sub/add overflow is a single CPU flag.