If I remember right, a double or float is broken into 3 parts: a sign bit, the exponent, and the mantissa.
When a double is shifted, do the bits shift the entire binary of the variable or does it just shift the mantissa?
If I remember right, a double or float is broken into 3 parts: a sign bit, the exponent, and the mantissa.
When a double is shifted, do the bits shift the entire binary of the variable or does it just shift the mantissa?
EDIT: Doh - ignore previous version of answer.
You can't shift floating point types - in C# at least.
On the other hand, if you were to multiple or divide by two repeatedly, you'd see what I mentioned before: within the range of normalized numbers, shifting left would increase the exponent by one and shifting right would decrease the exponent by one. Within denormal numbers, the exponent is fixed at 0, so the mantissa has to change.
EDIT: To answer your comment, a value represents a subnormal/denormal number if the exponent is zero and the mantissa is non-zero. See this page for more information on IEEE 754 in general, and I have a page on .NET binary floating point.
As far as I know, shift operators are only defined on Integers in .Net.