Question

For each of the following, assume that we are using a 32-bit system with single-precision (32-bit)...

For each of the following, assume that we are using a 32-bit system with single-precision (32-bit) floating point numbers (floats) in IEEE format, double-precision (64-bit) doubles in IEEE format, and 32-bit integers. Which of the following evaluate to true for all argument values? (Circle each that is always true).

char c = ..

int x = ..

short y = ..

float f = ..

double d = ..

  1. c == (char)(float) c
  2. y == (short)(int) y
  3. f == (float)(double) f
  4. d == (double)(float) d
  5. y == -(-y)
  6. f == -(-f)
  7. 3/4 == 3/4.0
  8. x == (x<<2)>>2
  9. y == (y>>2)<<2
  10. x<y == -x>-y

Homework Answers

Answer #1

c == (char)(float) c     (True)
    y == (short)(int) y       (True)
    f == (float)(double) f   (True)
    d == (double)(float) d   (False)
    y == -(-y)       (True)
    f == -(-f)       (True)
    3/4 == 3/4.0   (false)
    x == (x<<2)>>2   (false)
    y == (y>>2)<<2   (false)
    x<y == -x>-y   (True)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using the IEEE single-precision floating point representation, find the decimal number represented by the following 32-bit...
Using the IEEE single-precision floating point representation, find the decimal number represented by the following 32-bit numbers, each expressed as an 8-digit hex number. Express your answer using decimal scientific notation. (a) (C6500000)16 (b) (31200000)16
1. Assuming unsigned binary representation, convert 10110 (B) to decimal. Show work. 2 . Assuming unsigned...
1. Assuming unsigned binary representation, convert 10110 (B) to decimal. Show work. 2 . Assuming unsigned binary representation, convert 12 (D) to binary. Show work. 4. Assuming 9-bit two’s complement representation and let x be binary representation of 94 (D) a. Find x. Show work. b. Show the effect of the ASL operation on x, and then convert the result back to decimal. c. Show the effect of the ASR operation on x, and then convert the result back to...
java Write a single Java statements to accomplish each of the following: a) Displaythevalueoftheseventhelementofcharacterarraych. b) Considering...
java Write a single Java statements to accomplish each of the following: a) Displaythevalueoftheseventhelementofcharacterarraych. b) Considering “Scanner in = new Scanner (System.in);”, input a value into element 5 of one-dimensional double array nums. c) Initialize each of the four elements of the one-dimensional integer array test to 7. d) Declare and create an array called table as a float array that has four rows and three columns. e) Considering the following ArrayList declaration, insert “test” at the fourth position (index...
c++ language material Choose the correct answer please 1-When allocate memory with size 64 byte :...
c++ language material Choose the correct answer please 1-When allocate memory with size 64 byte : Int *m=new int [31]; Float *m=new float[8]; Double *m=new double[8]; Long *m=new long[16] 2-When print the address of the fifth character in pointer n on the screen : Printf("%p", n[4]); Printf("%p", n+5); Printf("%p",&n[4]); Printf("%p",n[5]); 3-to see the moving of a circle (circle(x,y,10)) from left top corner to right lower corner on the screen we need to ___________________ increase x and decrease y increase x...
For each of the following propositions, write in all comparisons that make it always true among...
For each of the following propositions, write in all comparisons that make it always true among the four possibilities: < > == != If none are guaranteed to hold, please indicate that explicitly by marking it with an X. Assume the variables are declared with int x,y; and initialized to some unknown values. You may assume that int’s are 32 bits wide, char’s are 8 bits wide and that right shift is arithmetical on signed numbers and logical on unsigned...
2 Convert each of the following octal numbers to 10-bit binary, hexadecimal, and decimal. Show your...
2 Convert each of the following octal numbers to 10-bit binary, hexadecimal, and decimal. Show your work. (a) 368 (b) 7568 3 Convert the following binary values into Decimal, Octal and hexadecimal. Show your work. (a) 111010101011112 (b) 1010111011001102 (c) 1011101010001112 (d) 1111101011102 4 Convert the following hexadecimal numbers to 16-bit binary and decimal numbers. Show your work. (a) FE9816 (b) FCAD16 (c) B00C16 (d) FEDF16 5 Perform the addition on the following unsigned binary numbers. Indicate whether or not...
In the following C code, Which variable if NOT of primitive data type? A. a B....
In the following C code, Which variable if NOT of primitive data type? A. a B. b C. c D. d int a = 10; double b = 20.0; float c = false; char d[5] = "Hello"; // here we define a string In programming language C, the implementation of a string data type is limited dynamic length, which means the length of a string variable is fixed once it has been defined. A. True B. False In C# programming...
Miscellaneous C knowledge. (Put all answers in the same q5.txt file, they’re all short.) (a) [2...
Miscellaneous C knowledge. (Put all answers in the same q5.txt file, they’re all short.) (a) [2 marks] On an old 16-bit computer system and its C compiler,sizeof(double)=8andsizeof(int)=2. Given the two type definitions below, what weresizeof(s)andsizeof(lingling)on that system? Assume that ins, there is no gap between the twofields. typedef struct s { double r[5];int a[5]; } s; typedef union lingling { double r[5];int a[5]; } lingling; (b) [2 marks] Given the following declarations, two questions: What is the type ofq? Whatis...
QUESTION 1 What does the following code segment output? int red, blue; red = 7; blue...
QUESTION 1 What does the following code segment output? int red, blue; red = 7; blue = red + 2 * 5 red++; blue = blue + red; cout << blue; 4 points    QUESTION 2 Is the following statement true or false? The Boolean expression in the following if statement will be true for all values of x in the range from 10 to 20 (including the endpoints) and false for all other values: int x; if (x >=...
PLEASE EXPLAIN EACH LINE OF CODE ONLY. USE COMMENTS NEXT TO EACH LINE TO EXPLAIN WHAT...
PLEASE EXPLAIN EACH LINE OF CODE ONLY. USE COMMENTS NEXT TO EACH LINE TO EXPLAIN WHAT EACH IS CODE IS DOING THANKS. PLEASE COPY PASTE AFTER YOURE DONE NOT SCREENSHOT BECAUSE I NEED TO BE ABLE TO EDIT IT THANKS. // MODULE B: Method 2: Embedding an in-line asssembly language module in a C progrmming #include "stdafx.h" #include "stdio.h" #include<iostream> int main () { printf(" Lab_No_01_Getting_Stated_into_x86_Assembly_from_a_C++_program\n"); // Lab number and title here printf(" Module B: Embedding an in-line asssembly language...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT