Re:Swedish Exchange paralyzed by buy order for "-6 stocks"
by CJefferson on Thursday November 29, 2012 @06:39AM
(#4847188)
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.
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.