Question: please write a function to check if the bit value if a special value in IEEE floating point format. the function uses switch loop to

please write a function to check if the bit value if a special value in IEEE floating point format.
the function uses switch loop to check the numbers taking in a 8 digit hexadecimal number as an IEEE 754 bit floating point number, find the real value and compare with cases which are positive, negative, infinite.... but you don't need to print the real value of input but you need to print the msg.
Implement a function which will check if the bit representation of a value is a special value in IEEE single precision floating point format. int is FP special(int value) { switch(value) { case 0: printf("FP Value is +0.0 "); break; case Ox80000000: printf("FP Value is -0.0 "); break; case Ox7F800000: printf("FP Value is +Inf "); break; case OxFF800000: printf("FP Value is -Inf "); break; default: if ((value & 0x7F800000) 0x7F800000 && (value & 0x007FFFFF) > 0) { printf("Value is Nan "); } else { return 0; // Not Special } } return 1; // Special }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
