64 ms·
Actually, I find you should always use signed ints. With signed ints, you can notice that '2-3' has below 0, and act accordingly. If you do '2-3' with unsigned
by CJefferson 14y ago
Actually, I find you should always use signed ints.
With signed ints, you can notice that '2-3' has below 0, and act accordingly. If you do '2-3' with unsigned ints, there is not really any way of finding out something went wrong (other than looking for very large numbers).
Of course, particularly in a financal system, you should probably use an integer type which throws/aborts if an out-of-bounds error occurs.