jeudi 20 avril 2017

Bitwise opperators seperating feilds

I am working on a program that will convert a floating point number base ten to its binary representation base two. I understand that we cannot use bit wise operators on floating point numbers, but I am told that if we use a cast to convert it to an unsigned int, we can. using unsigned int float_int = ((unsigned int)&f). My assignment states that we can separate out the two fields using bit wise operators. I have tried everything, but I cannot come up with a solution that will separate a number from it's decimal. Can someone help me? Thanks.

Aucun commentaire:

Enregistrer un commentaire