Java Reference
In-Depth Information
hexadecimal system, base 16. In the hexadecimal system, we run out of the usual
one-character digits so we use the first six capital letters of the alphabet for the
last six digits.
Each of these systems uses a
positional notation
to represent the integers.
For example, consider the decimal number 536, which, to make clear that a base-
10 number is meant, we write as:
(536)
10
The
6
is in the
units
position, the
3
is in the
tens
position, and the
5
is in the
hun-
dreds
position. This number is a representation for the quantity
5*10
2
+ 3*10
1
+ 6*10
0
Each of the digits
5
,
3
, and
6
is a base-
10
digit, i.e. is in the range
0..9
. A
k
-digit decimal integer in the form
d
k-1
...d
2
d
1
d
0
, where each
d
i
is in the
range
0..9
and
d
k-1
is not
0
, represents the integer:
d
k-1
*10
k-1
+ ... + d
1
*10
1
+ d
0
*10
0
Here is an integer in the binary, or the base-2, number system:
0
0
0
0
1
1
1
1
2
0
2
2
2
10
2
1
3
3
3
11
4
4
4
100
2
2
5
5
5
101
6
6
6
110
7
7
7
111
8
10
8
1000
2
3
9
11
9
1001
10
12
A
1010
11
13
B
1011
12
14
C
1100
13
15
D
1101
14
16
E
1110
15
17
F
1111
2
4
16
20
10
10000
20
24
14
10100
2
6
64
80
40
1000000
decimal
octal
hexadecimal
binary
power of 2
Figure III.1:
Integers in four number systems
Search WWH ::
Custom Search