Native / Interactive case study / 18 min read
Windows Calculator: why does 200 + 10% equal 220?
Use REA to investigate Windows Calculator’s percent key. Compare addition and multiplication, inspect the branch, and test a two-operand demo.
On this page
01. Try it before taking it apart
Leave the numbers at 200 and 10. Press Apply %: the second number becomes 20. Press Then = to get 220. Switch to multiplication and repeat: the second number becomes 0.1, and the final result is 20.
200 + 10%
Press % to see what happens to the second number.
Try addition, then multiplication, with the same two numbers.
A two-operand percent experiment, not a complete Windows Calculator emulator.
A two-operand percent experiment and a test matrix that checks intermediate state as well as the final answer.
Before the investigationNo setup for the lab. For binary inspection, use a Windows Calculator installation you can inspect and a configured native provider. The public Microsoft source provides an additional crosscheck. Set up REA →
02. Write down the button sequence
Ask a precise question: what happens when the user enters 200, chooses addition, enters 10, presses percent, then equals? Record the display after percent as well as after equals. The intermediate operand tells you more than the final answer alone.
This is standard-mode behavior. Keep mode, release and key sequence in the test record. Repeated equals, an omitted operand and a second percent press introduce additional state; leave those out of the first experiment.
Investigate Windows Calculator standard-mode percentage behavior with REA. Compare the sequences 200 + 10 % = and 200 × 10 % =. Identify which installed module handles arithmetic, then trace the percent branch and operator-dependent operand transformation. Keep observed instructions, source interpretation and actual GUI input results separate.03. The launcher may not contain the calculation
Opening a conveniently named executable is not enough. If it dispatches to another application, follow that handoff into the installed package. Record the file you actually analyzed and its hash.
In the upstream investigation, the arithmetic was in CalcViewModel.dll rather than the small calc.exe launcher. The report used analyst-assisted function selection. Its public Microsoft source reference helped interpret operator IDs; that reference was not proven to be the exact source commit of the installed binary.
- Which file contains the arithmetic branch?
- What selects percent, and what records the previous operator?
- Where are the previous value and current entry stored?
- Which arithmetic helpers are reached on each branch?
04. Rebuild the operand transformation first
For addition and subtraction, the entered percentage is relative to the first number. For multiplication and division, it becomes a fraction of 100. The pending operator is applied afterward. Keep those two stages separate in your implementation and in the interface.
Our lab makes you press percent and equals separately so you can see that state change. Editing either input or switching operators starts a fresh sequence. It accepts two finite numbers, not an arbitrary calculator expression.
Implement only this standard-mode two-operand percent behavior: + and − transform the entry to entry × (first / 100); × and ÷ transform it to entry / 100. Keep the transformed operand available for tests. Apply the pending operator only on equals. Handle division by zero, empty input and reset. Do not claim repeated-key or scientific-mode compatibility.05. Test the intermediate value, not only the answer
Two mistakes can sometimes cancel out and produce the expected final answer. Assert the transformed operand first, then the result. Include subtraction, division, zero and a negative first number so the test suite cannot pass by hardcoding the familiar addition example.
If your fresh Windows run differs, check mode and exact input order before revising the formula. Save the key sequence and display states. The upstream report did not claim a completed original Windows GUI input check, so do not silently inherit one.
06. Compare known results
Use these as explicit checkpoints. Matching them supports this small rule; it does not establish whole-application compatibility.
| Key sequence | After % | After = |
|---|---|---|
| 200 + 10 % = | 20 | 220 |
| 200 − 10 % = | 20 | 180 |
| 200 × 10 % = | 0.1 | 20 |
| 200 ÷ 10 % = | 0.1 | 2,000 |
| 50 + 20 % = | 10 | 60 |
| 6 × 6 % = | 0.06 | 0.36 |
| 200 ÷ 0 % = | 0 | Undefined |
Save both files in the same folder. Run the checks with Node.js; no package installation is needed.
node check-case-labs.mjs07. What was actually verified?
This site runs numeric tests against its own two-operand implementation, including the published Microsoft examples. It does not execute Microsoft’s test suite or automate the installed Windows application. Repeated percent, repeated equals, full expression parsing and scientific mode are outside the demo.
Read this site’s recorded numeric test results →
Sources: REA’s calculator evidence report · Microsoft’s pinned percent branch. Tutorial, illustrations and browser experiments independently authored.
New to the tool? What is REA? · How we check our guides