Why NULL is 0
William E. Davidsen Jr
davidsen at steinmetz.steinmetz.ge.com
Thu Apr 7 00:12:32 AEST 1988
In article <7792 at alice.UUCP> ark at alice.UUCP writes:
}In article <10229 at steinmetz.steinmetz.ge.com>, davidsen at steinmetz.UUCP writes:
}
}> People (usually ;>) have no problem with the idea the while assigning a
}> zero to a float gives it the vaule 0.0, in most implementations the
^^^^
Foot in mouth time... I think "some" would be more correct.
}> float value does not have all bits set to zero.
}
}I am overwhelmed by curiosity. Can you give me examples of
}three machine architectures in which the floating-point value
}0 does not have all its bits set to zero?
No. I can tell you two series of systems which have non-zero 0.0
(Honeywell 6000 and DPS), two which I'm told have non-zero 0.0 (mid 70's
IBM minis and Data General). My reasoning is as follows:
given: there are machines which do have C and don't have
flat 0 expressed as all bits zero,
and the proposed C standard doesn't say that any machine
running C must have float 0 be all bits zero,
and I have no reason to think that innovation and
standards have stopped evolving,
therefore: I conclude that assuming float 0 to be all bits
zero, or any other machine independent integer value,
is non-portable, now and in the future.
In light of the previous discussion, I was discussing "really
portable" as opposed to "portable to many machines."
--
bill davidsen (wedu at ge-crd.arpa)
{uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me
More information about the Comp.lang.c
mailing list