Because the type doesn't happen next week.andreio wrote:It wasn't a typo. Is it reasonable to assume you'll win a lottery next week? No?! Then why is it reasonable to assume it is a typo when the odds are practically the same?
Is it reasonable for a lottery winner to assume he won the lottery, even though the probability of winning the lottery is 1 in a million? Yes, it is very reasonable.
If I show you a very rich person, what are the chances that he won the lottery? Clearly they are far higher than 1 in a million. You can't compare him with an arbitrary person. You have to compare him with the average "very rich" person. There are fewer of those, and many lottery winners are among them.
So you have to be very careful when doing statistics. In particular, you have to really understand what you are doing and what the numbers mean.
Looking for an explanation of the floating-point comparison, the best you can do is start with listing possible scenarios. Then for each of these scenarios, you calculate the probability of the floating-point comparison getting into the code. Only if that probability is astronomically small can you reject the scenario. It makes very little sense to compare the probabilities you get for different scenarios. Finding someone guilty is not about "what scenario has fewer somewhat less probable events that I happen to know of".
In the typo-scenario, the probability of it happening is small, but not ridiculously small. Typos happen quite often and this typo happens to be one that the compiler does not catch and does not result in misbehaving code. When writing thousands of lines of programming code, difficult to discover typos are bound to happen. That it happened in precisely this place has by itself of course a very small probability, but it is the reason that we are talking about. Had it happened somewhere else, we would not have been discussing this quirk, but another one.