dreammartinez2605 dreammartinez2605
  • 18-10-2019
  • Computers and Technology
contestada

What is the range of values that a short can represent?

a. 0 to 256
b. -127 to 128
c. Math.pow(-2.0,15.0) to (Math.pow(2.0,15.0) -1)
d. 0 to Math.pow(2.0,16.0)

Respuesta :

ExieFansler ExieFansler
  • 18-10-2019

Answer:

c. Math.pow(-2.0,15.0) to (Math.pow(2.0,15.0) -1).

Explanation:

short represents a 16-bit signed integer. short is used to save memory because it occupies less space than integers where integers occupy 4 bytes short occupies 2 bytes.

Since it is signed so first bit is used to represent the sign if 0 then positive and 1 then the integer is negative.We are left with 15 bits.

So the range is -2¹⁵ to 2¹⁵-1.

Hence the answer is option c.

Answer Link

Otras preguntas

Lisa says that 43 is a 2 -digit odd number that is composite .Is she correct? Explain.
Write a literal equation to calculate the volume of a box
-5.47 and 5.47 on a number line is equal to |-5.47|.Explain her error.
Difference between gynosperms and angiosperms
Which of these factors helped hide economic problems in the 1920s? a. Investors lost confidence in the market. b. Farmers sold crop surpluses to pay off their d
Which of these factors helped hide economic problems in the 1920s? a. Investors lost confidence in the market. b. Farmers sold crop surpluses to pay off their d
Which is a counterexample to the conjecture? Any number that is divisible by 3 is divisible by 9. A. 69 B. 18 C. 27 D. 63
Lisa says that 43 is a 2 -digit odd number that is composite .Is she correct? Explain.
A lawnmower runs on gasoline.what type of energy transformation takes place in its engine?
if you triple one eighth of my number you get 9