As I was walking up the stair
I met a man who wasn’t there.
He wasn’t there again today.
I wish, I wish he’d stay away.

Much philosophical mischief stems from the fact that the word ‘nothing’ has the status of a noun. Nouns generally denote something and the philosopher who demands inviolate rules will ask what thing ‘nothing’ denotes. They sometimes try to invent something new for their ontology for “nothing” to be the name of. Such a stance forces us to both assert and deny that nothing belongs to the empty set.

This language convention is syntactically and grammatically convenient as it allows us to say “Nothing is red.” rather than the longer “There is not a thing such that that thing is red.”. Semantically, ontologically and logically, however, the convention is a disaster.

Some computer architectures tread into this morass with the IEEE floating point ‘value’ called “NaN” (Not a Number). This invites endless questions such as whether NaN = NaN. The convention is ‘no’ which violates the rule that a denotation always denotes the same thing. It also messes up the hardware compare logic as well as the program logic required to compare two structures with floating fields. The contents of a cell declared to hold a floating value, such as the cell created by the C declaration “float g;”, should hopefully always denote a number.

To assert that NaN = NaN has similar problems and thus the problem seems to fall back on the decision to introduce the denoter NaN which indeed fails to denote.

Modern sort routines require as an argument, a threshold predicate with which to compare two records. The predicate is required to be transitive which the IEEE floating compare is not. If a record consists of or contains a float, what predicate do you provide? Any answer is ugly.

In short it violates several axioms which were once useful in formal and informal reasoning about program behaviors.

I admit the utility of NaN in some contexts as when you do a vector operation on n floating values and want most of the results despite the fact that some of the n input values fall outside the range of definition for the operation at hand. If some out of band indication for domain faults were provided the problems might be avoided. I don’t know how to do this. Several practical problems would be ameliorated, however, if it were possible in the declaration of a variable to assure that it would always hold a value that actually denotes a number.

similar notes; xkcd