The Bug in Windows Calculator and other Windows Calculator uses

Export to PDF | Export to DOC

Windows Calculator has a bug
Windows calculator has been part of Windows since 1989 when windows version 3.0 was introduced. A lot has changed in Windows over the years from Windows 3.0 to Windows 95, to XP, and now to the current version Windows 8, but one thing has remained the same, the Windows calculator.

What also has stayed the same is a little known bug that has existed in the Windows calculator since it was first introduced.

To see the bug subtract 2 from the square root of 4.


The square root of 4 is 2 and “2-2” should give 0. But the Windows calculator gives a small negative number as the result instead of 0. In “Standard” calculator mode, the result is “-1.068281969439142e-19 ” and in the “Scientific” calculator mode, the result is “-8.1648465955514287168521180122928e-39”.

The error can be reproduced with similar calculations. The “sqrt(9)-3” or “sqrt(16)-4” and so on.

The reason for the bug is the way Windows calculator computes sqrt operations. The results are stored as floating point numbers instead of integers and their is a small precision error when it comes to floating point calculations.

And did you know the Windows Calculator can do these…

  • Calculate days between two dates. With the Windows 7 Calculator go to “View”->”Date Calculation”. Enter two dates and the calculator will give you the difference as days or in “years/months/weeks/days”. You can also find out the date that comes after adding or subtracting a specific number of days from a particular date.

  • Convert between different units of measurement. You can convert cm to inches, Celsius to Fahrenheit and a lot more. To access Unit conversion, choose “View”-> “Unit conversion”.

  • Mortgage Calculator. Use the Windows calculator to find out how much your monthly payments are. Access it from “View”->”Worksheets”->”Mortgage”. Input your loan amount, down-payment, term and the interest.

  • Fuel Economy. Want to know how much gas mileage you are getting? Next time you take a trip, enter the distance traveled and the liters or gallons of gas used. To calculate this use the “View”->”Worksheets”->”Fuel economy”.

Leave a Reply

Your email address will not be published. Required fields are marked *