Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the Code in C for the following functions. char bits_int(float f) return *(int*)&f; 1% Write a function that returns the sign of a float
Write the Code in C for the following functions.
char bits_int(float f) return *(int*)&f; 1% Write a function that returns the sign of a float as a char. You should call bits_int to get the bits in an int and return '1' if the sign is negative else return '0'The function should accept a float and return a string. Write a function that returns the sign of a float as an integer. You should call bits_int to get the bits in an int and return -1 if the sign is negative else return 1. The function should accept a float and return an int. 1% Write a function to return a string containing the actual binary value of the exponent of a float in a char array. You should call bits int to get the bits in an int and return the string Example: for f =-15.375 n = 11000001011101100000000000000000 the exponent bits are "10000010" The function should accept a float and return a string char bits_int(float f) return *(int*)&f; 1% Write a function that returns the sign of a float as a char. You should call bits_int to get the bits in an int and return '1' if the sign is negative else return '0'The function should accept a float and return a string. Write a function that returns the sign of a float as an integer. You should call bits_int to get the bits in an int and return -1 if the sign is negative else return 1. The function should accept a float and return an int. 1% Write a function to return a string containing the actual binary value of the exponent of a float in a char array. You should call bits int to get the bits in an int and return the string Example: for f =-15.375 n = 11000001011101100000000000000000 the exponent bits are "10000010" The function should accept a float and return a stringStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started