Converting byte[] of binary fixed point to floating point value?

System. BitConverter works very slow, so if performance is significant to you, i'd recommend to convert bytes to int by yourself (via logical shifts). Also, please specify in what exact format floats are sent in your protocol.

Ok, after asking some questions from a local expert on the source material, it turns out CodeInChaos was on the right track...if the value is 8 bytes with a -3 byte offset, then I can use BitConverter. ToInt64 / 256^3, if it is 4 bytes with a -1 byte offset then BitConverter. ToInt32 / 256 will produce the correct answer.

I guess that means BitConverter. ToXXX where XXX is signed is smart enough to handle the twos-complement calculations!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions