Why NULL is 0

Ed Hook hook at jvnca.csc.org
Fri Apr 8 02:53:30 AEST 1988


In article <1323 at PT.CS.CMU.EDU> edw at IUS1.CS.CMU.EDU (Eddie Wyatt) writes:
>Aside:
>
>> 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
>> float value does not have all bits set to zero.
>
>  I do believe IEEE and Vax's version of float is a bit pattern
>consisting of all zeros.  So what are these implementations that don't
>use zero bit pattern?
>

   There's at least one architecture with this characteristic. The Control
Data Cyber 205 ( and its successor, the ETA^10 ) employ a 64-bit floating
point representation in which zero appears as

                    8000 0000 0000 0000 ;

in fact, any word whose most significant nybble is an '8' is = 0.0 in this
system - the example above is the flavor of 0.0 which is produced by any
computation  whose result is zero ( and, thus, is the most familiar example 
of 0.0 ).

   I can't seem to find my copy of the IEEE Floating Point Standard & so can't
cite chapter & verse, BUT I don't believe that it requires a valid floating
point 0.0 to be represented by a bit pattern having all bits = 0. I say this
because it didn't appear to me that the 205's representation of floating point
quantities was in violation of the standard on this score, when I went through
the document recently. If I'm wrong in holding this opinion, I would appreciate
being set straight ...

Ed Hook
Control Data Corporation
John von Neumann National Supercomputer Center
Princeton, NJ

"If I said it, it's MY opinion ... at least for now ..."



More information about the Comp.lang.c mailing list