|
Part I Standard Representations |
|
|
|
|
3 | (16) |
|
|
3 | (5) |
|
1.2 The Big Three (and One Old Guy) |
|
|
8 | (2) |
|
1.3 Converting Between Number Bases |
|
|
10 | (6) |
|
|
16 | (3) |
|
|
16 | (1) |
|
|
17 | (2) |
|
|
19 | (62) |
|
2.1 Bits, Nibbles, Bytes, and Words |
|
|
19 | (2) |
|
|
21 | (4) |
|
|
21 | (1) |
|
2.2.2 Storage in Memory: Endianness |
|
|
22 | (3) |
|
2.3 Operations on Unsigned Integers |
|
|
25 | (29) |
|
2.3.1 Bitwise Logical Operations |
|
|
25 | (5) |
|
2.3.2 Testing, Setting, Clearing, and Toggling Bits |
|
|
30 | (3) |
|
|
33 | (4) |
|
|
37 | (4) |
|
|
41 | (11) |
|
|
52 | (2) |
|
2.4 What About Negative Integers? |
|
|
54 | (2) |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
55 | (1) |
|
2.5 Operations on Signed Integers |
|
|
56 | (11) |
|
|
56 | (2) |
|
|
58 | (9) |
|
|
67 | (9) |
|
|
67 | (2) |
|
2.6.2 Arithmetic with BCD |
|
|
69 | (1) |
|
2.6.3 Conversion Routines |
|
|
70 | (3) |
|
2.6.4 Other BCD Encodings |
|
|
73 | (3) |
|
|
76 | (5) |
|
|
77 | (2) |
|
|
79 | (2) |
|
|
81 | (36) |
|
3.1 Floating-Point Numbers |
|
|
81 | (3) |
|
3.2 An Exceedingly Brief History of Floating-Point Numbers |
|
|
84 | (1) |
|
3.3 Comparing Floating-Point Representations |
|
|
85 | (4) |
|
3.4 IEEE 754 Floating-Point Representations |
|
|
89 | (8) |
|
3.5 Rounding Floating-Point Numbers (IEEE 754) |
|
|
97 | (3) |
|
3.6 Comparing Floating-Point Numbers (IEEE 754) |
|
|
100 | (2) |
|
3.7 Basic Arithmetic (IEEE 754) |
|
|
102 | (3) |
|
3.8 Handling Exceptions (IEEE 754) |
|
|
105 | (3) |
|
3.9 Floating-Point Hardware (IEEE 754) |
|
|
108 | (2) |
|
3.10 Binary Coded Decimal Floating-Point Numbers |
|
|
110 | (3) |
|
|
113 | (4) |
|
|
114 | (1) |
|
|
115 | (2) |
|
4 Pitfalls of Floating-Point Numbers (and How to Avoid Them) |
|
|
117 | (22) |
|
|
117 | (2) |
|
|
119 | (11) |
|
4.3 Avoiding the Pitfalls |
|
|
130 | (4) |
|
|
134 | (5) |
|
|
135 | (1) |
|
|
135 | (4) |
|
Part II Other Representations |
|
|
|
5 Big Integers and Rational Arithmetic |
|
|
139 | (44) |
|
5.1 What is a Big Integer? |
|
|
139 | (1) |
|
5.2 Representing Big Integers |
|
|
140 | (6) |
|
5.3 Arithmetic with Big Integers |
|
|
146 | (12) |
|
5.4 Alternative Multiplication and Division Routines |
|
|
158 | (9) |
|
|
167 | (4) |
|
5.6 Rational Arithmetic with Big Integers |
|
|
171 | (6) |
|
5.7 When to Use Big Integers and Rational Arithmetic |
|
|
177 | (3) |
|
|
180 | (3) |
|
|
180 | (1) |
|
|
181 | (2) |
|
|
183 | (32) |
|
6.1 Representation (Q Notation) |
|
|
183 | (5) |
|
6.2 Arithmetic with Fixed-Point Numbers |
|
|
188 | (6) |
|
6.3 Trigonometric and Other Functions |
|
|
194 | (10) |
|
|
204 | (7) |
|
6.5 When to Use Fixed-Point Numbers |
|
|
211 | (1) |
|
|
212 | (3) |
|
|
212 | (1) |
|
|
213 | (2) |
|
|
215 | (20) |
|
7.1 What is Decimal Floating-Point? |
|
|
215 | (1) |
|
7.2 The IEEE 754-2008 Decimal Floating-Point Format |
|
|
216 | (9) |
|
7.3 Decimal Floating-Point in Software |
|
|
225 | (7) |
|
7.4 Thoughts on Decimal Floating-Point |
|
|
232 | (1) |
|
|
233 | (2) |
|
|
234 | (1) |
|
|
234 | (1) |
|
|
235 | (30) |
|
|
235 | (2) |
|
|
237 | (16) |
|
8.3 Functions and Intervals |
|
|
253 | (5) |
|
|
258 | (4) |
|
8.5 Thoughts on Interval Arithmetic |
|
|
262 | (1) |
|
|
263 | (2) |
|
|
263 | (1) |
|
|
263 | (2) |
|
9 Arbitrary Precision Floating-Point |
|
|
265 | (28) |
|
9.1 What is Arbitrary Precision Floating-Point? |
|
|
265 | (1) |
|
9.2 Representing Arbitrary Precision Floating-Point Numbers |
|
|
265 | (5) |
|
9.3 Basic Arithmetic with Arbitrary Precision Floating-Point Numbers |
|
|
270 | (3) |
|
9.4 Comparison and Other Methods |
|
|
273 | (1) |
|
9.5 Trigonometric and Transcendental Functions |
|
|
274 | (4) |
|
9.6 Arbitrary Precision Floating-Point Libraries |
|
|
278 | (12) |
|
9.7 Thoughts on Arbitrary Precision Floating-Point |
|
|
290 | (1) |
|
|
291 | (2) |
|
|
291 | (1) |
|
|
292 | (1) |
|
|
293 | (50) |
|
|
293 | (1) |
|
10.2 Logarithmic Number System |
|
|
293 | (14) |
|
10.3 Double-Base Number System |
|
|
307 | (17) |
|
10.4 Residue Number System |
|
|
324 | (8) |
|
10.5 Redundant Signed-Digit Number System |
|
|
332 | (7) |
|
|
339 | (4) |
|
|
340 | (1) |
|
|
341 | (2) |
Index |
|
343 | |