Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Shift oprator for Float type data variables

Status
Not open for further replies.

Sudarsan_EDA

Member level 2
Member level 2
Joined
Jun 10, 2010
Messages
44
Helped
11
Reputation
22
Reaction score
11
Trophy points
1,288
Location
India
Activity points
1,523
Hi to all,

I want to use Shift operator for Float data type as int Data type Variables.
Is it possible? & How to split the Float value into char.
 

why do you want to do that? if you want to see how does a float number gets stored then you can typecast and see the hex/decimal representation. You can also extract the sign bit, mantissa and exponent from that representation.

"How to split Float value into char" is not clear...
 
Dear Agarwal,
Thanks for your reply Plz send How to extract the sign bit, mantissa and exponent from that representation.
 

Depends on the format in which the float numbers are stored...pls refer these links
**broken link removed**
**broken link removed**

take for example the number +1.5
If it is a 32 bit (single precision) format then it will be stored as 0x3FC00000. You can extract it as:
Num = 0x3fc00000
SignBit = (Num >> 31) & 0x1
Exponent = (Num & 0x7f800000) >> 23
Mantissa = (Num & 0x007fffff)
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top