![]() If you watch the display as you go through this exercise, you will even see the number 3.6 appear in the display once you press the % key. Let’s walk through that algorithm with our first example. When the user enters a value, an operator, a second value, and then the percent key, the first two values are multiplied and the product divided by 100, and that result replaces the second value in the ongoing computation. Similarly, when the user enters A − B % =, the result should be A × (1 − B/100) or A − (A × B/100).Īha, the calculator engineer says, we can achieve this result by defining the percent key as follows: When the user enters A + B % =, the result should be A × (1 + B/100) or A + (A × B/100) after you distribute the multiplication over the addition. Okay, now that we see how the calculator product designer intended the percent key to be used, let’s look at what the calculator engineer it has to do in order to match the specification. ![]() A mathematician or engineer would have calculated the same result via the equivalent computation: For example, how much will you have to pay for that 20%-off sweater after adding 5% tax? You can chain these percentage operations, too. This is the correct answer, because 20% of 72 is 14.4. Similarly, suppose that sweater was on sale at 20% off. The result is 75.6, or $75.60, which is the correct answer, because 5% of 72 is 3.6. Suppose you want to compute how much a $72 sweater will cost after including 5% tax.¹ Pull out your handy pocket calculator² (or fire up Calc if you don’t have a pocket calculator) and type Let’s look at it from the point of view of that everyday person. But to an everyday person, it makes perfect sense. Therefore, the behavior of the key to you, an engineer, seems bizarrely counter-intuitive and even buggy. ![]() ![]() It was designed for your everyday person doing some simple calculations. What you first have to understand is that the percent key on those pocket calculators was not designed for mathematicians and engineers. The Windows calculator percent sign works the same way as those cheap pocket calculators (which are often called four-function calculators even though they have around six function nowadays). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |