[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [microblaze-uclinux] how is a float variable stored in a memory location?



Title: Message
Generally Float variables are stored in IEEE 754 format (exponential format) ...

Regards
Deepak
-----Original Message-----
From: owner-microblaze-uclinux@xxxxxxxxxxxxxx [mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] On Behalf Of Ujwal
Sent: Friday, July 14, 2006 10:07 AM
To: microblaze-uclinux@xxxxxxxxxxxxxx
Subject: [microblaze-uclinux] how is a float variable stored in a memory location?

hi all,
 
does anyone know how is a float variable is stored in a memory of 4 bytes??
 
 
i wanted to knw how to read the value from that memory location?
 
say..
-----------------------------------------
float a = 15.35;
char * ptr;
 
ptr = (char*) &a;
 
for ( i = 0;i< sizeof(float) ; i++) {
        printf("Address = %x \n", ptr + i );
        printf("value at address is  = %x \n", *( (char *) (ptr + i ))  );
 
}
 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com