BM Balmiki Mandal 06 Sep 2022 6 views 0 comments C Programming

Real Number representation or IEEE754 Standard in c

IEEE754 Standard Representation

How to Store float and double(real number) in the memory block real number means decimal number .so real number are stored in memory seprate  process name is IEEE754 Standard

 

IEEE754 Standard:

Float And Double Do not Depend upon the compiler it is a separate Standard name as IEEE754 Standard. so the Size of float and size of double depends upon the IEEE&54 standard.

Note: Real values or real data are not Compile with the compiler so it is compiled with Floating Coprocessor  and its's based on IEEE754 Standard

Here are the simple program to understand the bheviour

Printf("%d %d\n",sizeof(float),sizeof(double)); output:- 4 8
float f=23.5;
printf("%f %e %g\n",f,f,f);

Output: 23.500000 2.350000e+001 23.5

Note:

  • %f:-After the Data, it will print six Digit
  • %e:-This Is a formate Specifier it will print the data in standard Decimal Exponent Form
  • Standard Formate:- Digit.x^e4
  • %g:- This specifier for Scientific notation

Representation of Bit In IEE754 Standard 

  1. Most Significant Bit Indicates The Sign Bits
  2. The next 8 bits Represents Exponent Bits (In case of Double)
  3. Remaining 23 Bits (52 In case of double) are for the Significant Bit (Mentessa)

Step to get IEEE754 Representation for real number

Step1: to convert the real number into binary

float 23.7;

10111.1011

Step2: Convert The binary into Standard Binary Exponent Formate

             Bit.xe^y

Step3: Add or subtract the Exponent part with standard Bias no.

  • Float-3f
  • double-3ff

Note:

for Float IEEE754 Bias Number is 7f

for double IEEE754 bias number is 3ff

Step 04: Result of the third step put in Exponent part

Step 05: fill the Signig=ficant part with a significant bit left to right 

Step 06: put sign Bit 0 for positive, 1 for negative

0 Comments

No comments yet, Be the first to comment.

Post a Comment

Please sign in to post a comment.

Related Posts

C Bitwise Operators Explained: 10 Practice Programs with Output

E.1: Bitwise vs. Logical Operators#include<stdio.h> int main(void){ int x=7,y=19; printf("%d %d ",x&y...

AG Anvesh G 29 Nov 2026
Bit wise operators Assignment

Bitwise Operators practical assignment: Take runtime input, bit-level manipulation, and different data units r...

AG Anvesh G 27 Sep 2026
Understanding Float and Double Binary Representation in C

Understanding Float and Double Binary Representation in CIntroduction:When we store decimal numbers such as 10...

AG Anvesh G 31 May 2026