M
ma740988
I've got an unpacker that unpacks a 32 bit word into 3-10 bits samples.
Bits 0 and 1 are dont cares. For the purposes of perfoming an FFT and
an inverse FFT, I cast the 10 bit values into doubles. I'm told:
"floats and doubles have bits for mantissa and exponent. (I knew that).
If you are subtract bits that partly belong to mantissa and partly
belong to exponent, that hardly makes sense. Anyway, looking on bits
only, a float has 32 bits and doesn't behave different than a integer."
My advisor went on to say:
If I unpacked the samples into an - say an array of floats, it's quite
possible that I could get a left side value whose bits were
*very* different to th eright-hand integer *and* most likely wouldn't
match exactly to the integer.
So now:
float[0] = 0x2AA;
or better:
float f = (float)0x2AA;
cout << f << endl;
would show perhaps
682.00000123
Makes absolutely no sense to me. All machines I ran the source on
produced 682.00000000000 (depending of course on your precision).
Am I being mislead here?
Bits 0 and 1 are dont cares. For the purposes of perfoming an FFT and
an inverse FFT, I cast the 10 bit values into doubles. I'm told:
"floats and doubles have bits for mantissa and exponent. (I knew that).
If you are subtract bits that partly belong to mantissa and partly
belong to exponent, that hardly makes sense. Anyway, looking on bits
only, a float has 32 bits and doesn't behave different than a integer."
My advisor went on to say:
If I unpacked the samples into an - say an array of floats, it's quite
possible that I could get a left side value whose bits were
*very* different to th eright-hand integer *and* most likely wouldn't
match exactly to the integer.
So now:
float[0] = 0x2AA;
or better:
float f = (float)0x2AA;
cout << f << endl;
would show perhaps
682.00000123
Makes absolutely no sense to me. All machines I ran the source on
produced 682.00000000000 (depending of course on your precision).
Am I being mislead here?