Operations On Scaled Values
Once the scaled representation of a real value is stored, the scaling can often be ignored until the value needs to come back into the "real world". For instance, adding two scaled values is just as valid as unscaling the values, adding the real values, and then scaling the result, and the former is much easier and faster. For other operations, however, the scaling is very important.
Multiplication, for instance, needs to take account of the fact that both numbers are scaled. As an example, consider two real world values A and B. The real world multiplication of these real world values is:
A * B = PNow suppose we're storing the values with a scale factor of Z. If we simply multiply the stored representations we'll get the following:
AZ * BZ = QNote how AZ is the scaled real world value or A or simply the product of A * Z, and likewise, BZ is the scaled representation of B. Also note that we didn't write PZ as the answer, the reason is simple: PZ is not the answer. You can see this by rearranging the statement, where each line in the following are equivalent:
AZ * BZ = Q A * Z * B * Z = Q (A * B) * Z * Z = Q P * Z * Z = Q PZ * Z = QNote how we substituted P for A * B on line 4. You can now see that the result of AZ * BZ (which is Q) is NOT PZ, it's PZ * Z. If PZ were the answer, we could simply store it directly, since it has the scale factor built in, as is the case with addition and subtraction. For multiplication, however, you can see that the product of two scaled values has an extra scaling built in. As long as this is taken into account, there's still no need to convert AZ and BZ into A and B before performing the operation, you just need to divide the result by Z before storing it back. You will then have PZ stored as the result of the multiplication, which is fine because you weren't storing the result of AZ * BZ, you were storing the scaled representation of the result of A * B.
Read more about this topic: Scale Factor (computer Science)
Famous quotes containing the words operations and/or values:
“A sociosphere of contact, control, persuasion and dissuasion, of exhibitions of inhibitions in massive or homeopathic doses...: this is obscenity. All structures turned inside out and exhibited, all operations rendered visible. In America this goes all the way from the bewildering network of aerial telephone and electric wires ... to the concrete multiplication of all the bodily functions in the home, the litany of ingredients on the tiniest can of food, the exhibition of income or IQ.”
—Jean Baudrillard (b. 1929)
“The values by which we are to survive are not rules for just and unjust conduct, but are those deeper illuminations in whose light justice and injustice, good and evil, means and ends are seen in fearful sharpness of outline.”
—Jacob Bronowski (19081974)