Panagiotis Varlagas

Ranch Hand

Posts: 233

posted 16 years ago

Hi all.

It seems I am debugging Mughal's mock exam these days...

Here is what I believe to be yet another (the 3rd I've found thus far) erratum:

QUESTION:

Which statements are true concerning the effect of the >> and >>> operators?

The following answer is considered to be correct:

(d) The value returned by >>> will never be negative

Here is a counterexample to prove the non-correctness of the answer:

-1 >>> 32

The value of this expression (-1) is negative, even though the value of the right operand is >= 1.

Panagiotis.

It seems I am debugging Mughal's mock exam these days...

Here is what I believe to be yet another (the 3rd I've found thus far) erratum:

QUESTION:

Which statements are true concerning the effect of the >> and >>> operators?

The following answer is considered to be correct:

(d) The value returned by >>> will never be negative

**as long as the value of the right operand is equal to or greater than one.**Here is a counterexample to prove the non-correctness of the answer:

-1 >>> 32

The value of this expression (-1) is negative, even though the value of the right operand is >= 1.

Panagiotis.

Don't get me started about those stupid light bulbs. |