News for hackers. Stuff that matters.
Re:Swedish Exchange paralyzed by buy order for "-6 stocks" by xyzzyz on Thursday November 29, 2012 @05:56AM (#4847091)
How about using programming language/number library that properly handles integer promotion or signals a condition when a number gets out of bounds. Obviously it's slower than unchecked processor integers, but as this story shows, in some circumstances it's well worth it.
Re:Swedish Exchange paralyzed by buy order for "-6 stocks" by ajuc on Thursday November 29, 2012 @06:02AM (#4847103)
Just validation of the input string would suffice. No need to use unsigned ints or promoted numerals.
Re:Swedish Exchange paralyzed by buy order for "-6 stocks" by KingMob on Thursday November 29, 2012 @12:02PM (#4848735)
Well, that's a start, but any subsequent math would involve numbers not directly entered by the user, so it's not sufficient by itself.