Re: [9fans] fun and scary evil C code



I lied.
They're actually using that stuff to pick apart the (presumed IEEE 754)
doubles into exponent, mantissa, ...

My questions still stand ...

Also, that file is such a tangled nest of ifdefs ...
is anyone sure whether (and if so, when) that code is invoked?

interesting conflicts on the web. http://en.wikipedia.org/wiki/IEEE_754
says c doesn't require ieee, http://home.datacomm.ch/t_wolf/tw/c/c9x_changes.html point #21.
says it does.

in any event, if ieee is used, i think the trick is safe.

- erik
.



Relevant Pages

  • Re: zero up memory
    ... IEEE calls sub-normals, for which the exponent must be 0; ... "normalised" (mantissa shifted as far left as possible). ...
    (comp.lang.c)
  • Re: Floating point issues
    ... bit, 5 exponent bits, 10 mantissa) and, after processing, back to IEEE ... What issues can I expect in terms of dynamic range, ...
    (comp.arch.embedded)
  • Re: Question about shuttle / ISS
    ... The value of 304.7999 can be obtained by doing the calculation in IEEE ... Doubles and then truncating ... magnitude at all relevant in any project where measurements on the ...
    (sci.space.shuttle)
  • Re: Get Mantissa and exponent from double?
    ... How do I get Mantissa and exponent from double? ... You might consider doubleToLongBitsand then check the IEEE 754 spec yourself. ... extracting the binary exponent and mantissa from the bit pattern. ...
    (comp.lang.java.help)
  • Re: BASIC REAL EXPONENT QUESTION
    ... I know that the maximum exponent available ... The IEEE single precision exponent is ... "NaN" depending on the value of the mantissa. ... Google for "IEEE floating point." ...
    (comp.lang.fortran)