# Floating Point Arithmetic

Waaaaaay back in college, I spent some time on queueing theory (you know, Poissan
distributions and all that). The most surprising part for me was that a random distribution
of arrivals pretty much ensures that you will have clusters that are very busy, and
times when you are totally idle. Once you work on the math a bit, you understand why,
but our commonplace notion is that "random" should be "smooth".

Incidentally, this also explains why it's so hard to determine whether environmental
factors are causing health issues. You can't just look at a cluster of cancer cases
(for example) and surmise that there is something causing it, since a random distribution
will give you clusters. So you have to do some fairly sophisticated mathematics to
determine whether the cluster is due to random chance or whether there is something
else going on.

If the average person understood this - and they could with some very simple experiments
- it would help science understanding immeasurably. Humans are programmed to extract
patterns from data, and it's not surprising that we see patterns that are really just
random chance.

So, once again, I've digressed a bit, but I assure you that this really does have
something to do with floating point arithmetic. The
point of the journey is not to arrive
...

I was talking about clustering, which brings us to the topic of newsgroup questions.
It's not uncommon to not get a specific question for 6 months, and then
get the same question 3 times in a week. The question for this week is "I'm doing
something mathematical, and the answers are wrong."

The problem usually has to do with the fact that the person asking the question doesn't
understand that floating point is an imprecise representation. I got this drummed
into me long ago in my numerical analysis class, where I learned (and promptly forgot)
all about poorly conditioned matrices and the like.

Back, once again, to the topic.

The canonical discussion of FP arithmetic (for this audience, at least) is a 1991
paper by David Goldberg titled "What
Every Computer Scientist Should Know About Floating-Point Arithmetic"

Even if you know a fair bit about FP math, there's a lot of good stuff there.

1. Eric,

You are correct, in a sense. That was last week’s question. This week, the question seems to have shifted to "why should I use an event instead of exposing a delegate as a public field/property".

Being a lurker in the newsgroups (haha), I have seen this behavior often. I think it is an interesting phenomenon, and perhaps measuring it in some way would be useful. Is there any chance of having the Netscan people over at MS Research integrating some sort of analysis into the tool to try and determine patterns in the questions that are being asked (and I don’t just mean doing a comparison of the titles).

– Nick

2. PeterHcy says:

I agree With What You Said!

3. MBA says: