C Programming - Floating Point Issues - Discussion

Discussion Forum : Floating Point Issues - General Questions (Q.No. 8)
8.
A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?
ABCD
DCBA
0xABCD
Depends on big endian or little endian architecture
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
36 comments Page 1 of 4.

Avi said:   1 decade ago
Simple answer (stack) :

For example memory location occupied for float (4 byte (32 bit) ) (1000 to 1003) and hex is ABCD (00001010 00001011 00001100 00001110).

MSB A B C D LSB.

Little endian architecture:- Lower byte (LSB) store first so,

1000-D.
1001-C.
1002-B.
1003-A.

Big endian architecture:- Higher byte (MSB) store first so,

1000-A.
1001-B.
1002-C.
1003-D.
(4)

Thenu said:   9 years ago
Thank you for all your explanation.
(1)

Sahithi said:   1 decade ago
Yes I need the single answer which is right its a little bit confusing.
(1)

Achal said:   1 decade ago
Hi bro I have doubt to store float value in given memory locations compiler follows IEEE 754 method, not endianness method.

I think endianness is for storing integer variable only.

Any info share with me I'm waiting.
(1)

Indhu said:   1 decade ago
I got confused by this different answers.

Please anyone give short and clear information.

Aishwarya gupta said:   1 decade ago
Thank you very much.

Raghu said:   1 decade ago
Thank you kavitha.

Shrikant said:   1 decade ago
Thanks Santosh.

A.Vamsi krishna said:   1 decade ago
Thanks to all for this great analysis and Indiabix.

Preeti said:   1 decade ago
Thank you kavitha:).


Post your comments here:

Your comments will be displayed after verification.