Question
Please help... Data structure in C... Problem 4 (C Arithmetic) We are running programs on a machine with the following characteristics: Values of type int
Please help... Data structure in C...
Problem 4 (C Arithmetic) We are running programs on a machine with the following characteristics: Values of type int are 32 bits. They are represented in twos complements, and they are right-shifted arithmetically. Values of type unsigned are 32 bits. Values of type float are represented using the 32-bit IEEE floating point format, while values of type double use the 64-bit IEEE floating point format. We generate arbitrary values x, y, and z and convert them to other forms as follows:
/* Create some arbitrary values */ int x = random(); int y = random(); int z = random(); /* Convert to other forms */ unsigned ux = (unsigned) x; unsigned uy = (unsigned) y; double dx = (double) x; double dy = (double) y; double dz = (double) z; For each of the following C expressions, you are to indicate whether the expression always yields true. If so, circle Y. If not, circle N. Provide an example if your answer is N.
Problem 4 (C Arithmetic) We are running programs on a machine with the following characteristics: - Values of type int are 32 bits. They are represented in two's complement, and they are right shifted arithmetically. Values of type unsigned are 32 bits. - Values of type float are represented using the 32-bit IEEE floating point format, while values of type double use the 64-bit IEEE floating point format. We generate arbitrary values x,y, and z, and convert them to other forms as follows: 1 Create some arbitrary values */ int x= random (); int y= random () ; int z= random (); / Convert to other forms / unsigned ux = (unsigned) x; unsigned uy = (unsigned) y; double dx= (double) x; double dy = (double) y; double dz= (double) z; For each of the following C expressions, you are to indicate whether the expression always yields true. If so, circle " Y ". If not, circle " N ". Provide an example if your answer is NStep 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