Pete Becker wrote:
> Alexander Bartolich wrote:
>> [...]
>> Applying bitwise operations to all bits of a floating point expression
>> generally makes no sense.
>
> Umm, that's exactly how many operations that fiddle with floating-point
> values are implemented. Granted, it's not for beginners. But it often
> does make sense.
The binary representation of an IEEE floating point number comprises
sign, exponent, and fraction. Meaningful manipulation of these parts
involves masking them out with »&«, right shift, doing some integer
math, left shift, and pasting them in again with »|«. This is completely
different from expressions like »3.141 & 2.718«.
>> Applying logical operations to a floating point expression involves
>> exact comparison to 0. Because of the fuzziness of floating point
>> values you should rather check for a epsilon-neighborhood.
>
> Sigh. This is, as always, dead wrong. Floating-point values are not
> fuzzy, they are exact.
http://www.parashift.com/c++-faq-lit...html#faq-29.17
--
Brüder, in die Tonne die Freiheit,
Brüder, ein Stoppschild davor.
Egal was die Schwarzen Verlangen
Rufen wir: Ja! Brav im Chor.