When you multiply them together you get 10 5x10 4 = 10 5+4 = 10 9, and a billion has 9 zeros. 1 followed by 5 zeros and 4 zeros respectively. It’s easier to figure out if you work with exponents and notice that 100,000 = 10 5 and 10,000 = 10 4, i.e. So if you wanted to record share prices with an accuracy of 1/100 of a US cent (one ten-thousandth of a dollar), you’d need to be able to represent numbers up to and beyond 1,000,000,000 (one billion), because there are one billion ten-thousandths of a dollar in $100,000. UK clothing chain Next is currently worth more than $10,000 a share on the London Stock Exchange, for example, and Swiss chocolatiers Lindt are currently trading at over $100,000 a share on the SIX Swiss Exchange. The idea is much the same as asking a bank teller to give you five $20s instead of one $100 – the total amount is the same but the lower value of the bills makes them easier to use in stores.Īpple, for example, has split five times since 1987 (2-for-1 in 1987, 20 7-for-1 in 2014 and 4-for-1 in 2020), so that one original Apple share has now turned into 2x2x2x7x4 = 224 contemporary shares, each worth 1/224th part of the original.īut you may be surprised just how high some individual share prices are. They therefore deliberately reduce the price per share without changing the value of the company by using “stock splits” to convert, say, 1 share costing $1000 into 5 shares of $200 each. In other words, if you had to pick an amount that would safely encompass the value of any share you needed to report upon, now and in the lifetime of your program, how high would you go, and then how much safety margin would you build in for the future?Īfter all, many hugely wealthy and successful companies have stock prices well below $10,000, because they want to avoid having share prices that are out of reach of all but the biggest investors. What’s the largest value in US dollars that a single share, in any publicly traded company anywhere in the world, could ever reach, and then some? So, with memories of Y2K firmly in mind (or stories of it, if you’re young enough ), let’s play a game. ( No point in rearranging the deckchairs on the Titanic.)Įxamples include: assuming that occasional and short-lived allocations of tiny amounts of some abundant system resource will always succeed assuming that two processes will never accidentally choose the same random filename and assuming that 640KBytes of memory should be enough for anyone.Īnother example, perhaps the one that best supports the motto simply never to say never, is assuming that two digits is enough to store the year, so that you can just write 83 instead of 1983, or 21 instead of 2021, and nothing bad will ever happen. This bug is only ever likely to happen if something else even more catastrophic has already happened, so there is no point in worrying about it now. ( Let’s come back and fix it later if anyone notices.) This bug is sufficiently unlikely, and simulating it correctly in testing would be sufficiently hard, that ignoring the error is a justifiable “technical debt” that is worth borrowing against now to meet a delivery deadline.This bug is so incredibly unlikely, and catering for it would so complex, that the code is more likely to be bug-free if you simply assume that the error will never happen.…and warns you that your while loop will never terminate, it really can and should use the word never.Ī variable declared unsigned can, by definition, never be negative and therefore the “conditional” expression i >= 0 isn’t conditional at all: it can be replaced by the constant 1, or TRUE, and can literally never be FALSE.īut there are many other programming cliches where coders ignore errors that might happen in theory, often for one or more of these reasons: Indeed, when it comes to programming, the only time that you should ever say, “This will never happen” is if you can show formally, for example with an accepted mathematical axiom or a proof, that it will quite literally never happen because it can’t.įor example, when a C compiler looks at this code… Regular readers of Naked Security will know that one of the truisms we like to trot out about cybersecurity is the wryly self-contradictory reminder that you should “ Never say never.”
0 Comments
Leave a Reply. |