Pre-Requisite: IEEE Standard 754 Floating Point Numbers
Write a program to find out the 32 Bits Single Precision IEEE 754 Floating-Point representation of a given real value and vice versa.
Input: real number = 16.75 Output: 0 | 10000011 | 00001100000000000000000 Input: floating point number = 0 | 10000011 | 00001100000000000000000 Output: 16.75
Bit Fields are assigned when we don’t require the full memory that is usually allocated to some variables but we want to limit the amount of memory taken up by those variables. In C, members of a Union share the common memory space and taken we can access the members only one at a time.
Below is the implementation of the above approach:
Program 1: Convert a real value to its floating point representation
IEEE 754 representation of -2.250000 is : 1 | 10000000 | 00100000000000000000000
Program 2: Convert a floating point representation to its real value
The float value of the given IEEE-754 representation is : -2.250000
- IEEE Standard 754 Floating Point Numbers
- C Program to Multiply two Floating Point Numbers
- Program for Binary To Decimal Conversion
- C Program for Decimal to Binary Conversion
- Lex program for Decimal to Hexadecimal Conversion
- Program for Octal to Decimal Conversion
- Program for Decimal to Binary Conversion
- Program for Decimal to Octal Conversion
- Measure execution time with high precision in C/C++
- C/C++ Program to Count set bits in an integer
- C Program for Number of jump required of given length to reach a point of form (d, 0) from origin in 2D plane
- 8085 program to move blocks of bits from source location to a destination location
- Introduction of Single Accumulator based CPU organization
- Working of 8085-based Single board microcomputer
- Multiplication Algorithm in Signed Magnitude Representation
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.