Little Endian machine
Which 5 digits from this number should be packed in a char* ?
Code:234.21234567
Little Endian machine
Which 5 digits from this number should be packed in a char* ?
Code:234.21234567
Last edited by AnishaKaul; 10-01-2010 at 06:55 AM. Reason: Modified question
To see how the number looks in 32/64-bit IEEE-754 floating-point format, take a look here:
IEEE-754 Floating-Point Conversion from Floating-Point to Hexadecimal
That might help you answer your question.
The real answer to the question "Which 5 bits?" imo must be "every one of them."
HTH
-- pete
Last edited by pete142; 10-01-2010 at 05:28 AM. Reason: expand answeer
Many thanks to you for the useful link.
The question has been modified now. I hope it is clear now.
That makes as much sense as which 5 pieces of clothing should I pack in my suitcase.
The answer to both of course being, whichever 5 you feel like.
Endian: It's not clear that anything here has to do with endianness
5 digits: Why would you want to pick exactly 5 of anything, where does the 5 come from? If you're supposed to only pick digits, then what's the dot for?
packed: This could mean a bunch of different things as there are plenty of ways of "packing" things.
char*: In other words a pointer. How is a pointer related to anything else here?
Whilst each of these things could mean something useful in the right context, they don't actually come together to form a meaningful question here.
Care to try again?
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"