7 ms·
Swedish Exchange paralyzed by buy order for "-6 stocks"
- rbanffy 14y agoRemember all those compiler warnings about mixing signed and unsigned integers? Now you know why.
- qvaetrain 14y agowhere did the -6 come from?
- srijan4 14y agoI'm guessing because 4294967290 = 2^32 - 6
- belorn 14y agoI guess someone wanted to buy 6 stocks, pressed wrong and made -6, and the program did not have any data checks and sent it to the market.
- ajuc 14y agoGreat way to sell actions at the price you like :)
- rpm4321 14y agoWell, they're going to have a lot of explaining to do when a dump truck shows up outside of their house with 4,294,967,290 stock certificates.
- jws 14y agoLike: What happened to the street when a dump truck loaded with 8500 tons of paper drove down it leaving deep trenches through the pavement. 4,294,967,290 at one sheet of paper per share is about one entire freight train of box cars. Depending on the paper.
- qvaetrain 14y agothanks, that makes sense
- yread 14y agoHow is that an explanation? Do you think someone wanted to buy 4 billion stocks?
- crntaylor 14y agoIn case anyone is perplexed by the "-6" comment, the decimal number -6 represented as a signed int in twos complement is 11111111111111111111111111111010 When interpreted as an unsigned int, this is 4,294,967,290 = 2^32 - 6.
- deleted 14y ago[deleted]
- raverbashing 14y agoAnd that's why you should always use unsigned ints And put sensible limits and checks in processing untrusted data (that is, everything that comes from the outside)
- xyzzyz 14y agoHow 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.
- Jabbles 14y agoThat's quite a controversial statement. Using unsigned ints may just clutter code without providing any safety. The value of 4e9 is still invalid, even though it's positive. As you say, checking your inputs is important, and in this case values can be too large, and should be rejected. For instance: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Integer%5FTypes http://google-styleguide.googlecode.com/svn/trunk/cppguide.x...
- raverbashing 14y agoThe issue is 4e9 is invalid but in the middle of the way (more often than not) this may be interpreted as a negative number. Hence you need to check for value 'bigger than allowed' and 'smaller than allowed' For unsigned ints, there is a natural smallest value allowed: zero. You're free to not follow my advice though. And the google style guide is subtle, it's not what you're implying. You can't use 'short' for example unless explicitly.
- unwind 14y agoAs a native Swedish speaker, I was curious to see how well the auto-translator would handle this rather niche financial text. The wording "The value of words corresponding to" in the second sentence confused me, but I first chalked it up to me not understanding finance-speak in English well enough. Then I realized hovering shows the original text, and investigated. The original Swedish text has a typo! It says "orden" (="the words") where it should say "ordern" (="the [purchase] order"). I found that amusing. :)
- rpm4321 14y agoJust curious, how accurate was the rest of the translation?
- thiderman 14y agoAlright, but it has its faults - it missed the word "error": "Instead, it is about a parsing [error] incurred in exchange system due to a technical error"
- unwind 14y agoWell, for a translation about finance it is (very!) surprising that it seems to have just transformed "kronor" (="crowns", the everyday name for the SEK, the Swedish currency) into "dollars". It's not as they two currencies are 1:1, or even close to it. Very strange. Also there was a Swedish word that was just copied ("anullerades", meaning more or less "cancelled", "voided" or something along those lines) into the English text. But, overall, it's still rather impressive.
- deleted 14y ago[deleted]
- tallanvor 14y agoOne of the things Google Translator is horrible about is translating stuff like kroner into dollars, SEK into USD, etc. Granted, there are cases where translating kroner into dollars is ok, but I'm guessing this is the wrong translation most of the time.
- darylteo 14y agoEquivalence class testing, yo.
- proemeth 14y ago"Sweden's gross domestic product, by comparison, amounted in 2011 to more than 3500 billion." The irony. Looks like a typo, it should be around 500bn$. 3500 would be Germany. Proof that "fat finger" human mistakes can do as much damage as algos gone wild.
- sesqu 14y agoAs mentioned in another comment, it's not a typo, it's a translation error. It's actually 3500 billion SEK, which is roughly 500 billion USD.
- deleted 14y ago[deleted]
- LarryMade 14y agoIn the stock market there are no sanity checks, else the whole thing would grind to a halt. :-)