Game Development Reference
In-Depth Information
In the last example, when you carry out the multiplication of the denomi-
nator, you arrive at a positive number. When you multiply the numerators,
you end up with a negative number. Alternatively, you can first carry out
the divisions. In the first case, you divide a positive number by a negative
number, resulting in a negative number. In the second case, you divide
a negative number by a negative number resulting in a positive number.
The final multiplication then is a negative number multiplied by a positive
number, resulting in a negative number.
Multiplication and Division with More Than Two Numbers
When you deal with a sequence of divisions or multiplications, the outcome
differs according to the last operation you carry out. Consider the following
operations:
ð 4 Þð 4 Þð 4 Þ¼ 64
2 3 3 ¼ 18
1
2
8 3
9
32
ð 2 Þð 2 Þð 2 Þð 2 Þ¼ 16
3
2 ¼
In the first example, three negative numbers multiplied together result in a
number that is negative ( 64). One way to examine this activity involves con-
sidering that the first two numbers when multiplied result in a positive number
(16). When you multiply 16 by 4, however, you end up with a negative number.
To trace how a negative number results from multiplication of an odd sequence
of negative numbers, consider that when you multiply the first two negative
numbers, the result is positive. However, when you then multiply this number by
a negative number, the result is negative. When you multiply by yet another
negative number, then the result becomes positive. Consider a set of multi-
plications that proceed in this way:
ð 2 Þð 2 Þ¼ 4
Two numbers are even
:
ð 2 Þð 2 Þð 2 Þ¼ 8
:
Three numbers are odd
ð 2 Þð 2 Þð 2 Þð 2 Þ¼ 16
Four numbers are even
:
ð 2 Þð 2 Þð 2 Þð 2 Þð 2 Þ¼ 32
Five numbers are odd
:
 
Search WWH ::




Custom Search