Answered step by step
Verified Expert Solution
Link Copied!

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.image text in transcribed

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 string

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions