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] representation of FLOAT in c++

Status
Not open for further replies.

m2star

Junior Member level 1
Joined
May 1, 2010
Messages
18
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Location
Rawalpindi, Pakistan, Pakistan
Activity points
1,390
union {uchar byt[4]; float wrd;} asdf;
asdf.wrd=45.6546

i do have a code that contains above function
can any one tell me, in which form this constant data is being stored in the float
like how can i specify that
asdf =[????]
 

  • Like
Reactions: m2star

    m2star

    Points: 2
    Helpful Answer Positive Rating
To be precise, C or C++ don't rely on a specific number representation, neither for integer nor float quantities. This point is considered implementation dependent. Fixing a specific number format (nevertheless most compilers are using IEEE-754) would foil code portability.
 
  • Like
Reactions: m2star

    m2star

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top