Java supports only signed numbers end 222 unsigned

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: default), either arithmetic or logical shifts may be used. This unfortunately means that any code assuming one form or the other will potentially encounter portability problems. In practice, however, almost all compiler/machine combinations use arithmetic right shifts for signed data, and many programmers assume this to be the case. Practice Problem 2.11: Fill in the table below showing the effects of the different shift operations on single-byte quantities. Write each answer as two hexadecimal digits. x 0xF0 0x0F 0xCC 0x55 x << 3 x >> 2 (Logical) x >> 2 (Arithmetic) 2.2. INTEGER REPRESENTATIONS C Declaration char unsigned char short [int] unsigned short [int] int unsigned [int] long [int] unsigned long [int] Guaranteed Minimum Maximum 127 127 0 255 32,767 32,767 0 63,535 32,767 32,767 0 65,535 2,147,483,647 2,147,483,647 0 4,294,967,295 Typical 32-bit Minimum Maximum 128 127 0 255 32,768 32,767 0 63,535 2,147,483,648 2,147,483,647 0 4,294,967,295 2,147,483,648 ¾ ½ ¿ 0 4,2...
View Full Document

Ask a homework question - tutors are online