Yesterday we posted about a bug found in Windows 8:
Windows 8 Taskbar Context Menu Bug
And now its turn of Windows Calculator. Almost all Windows users use the default Calculator application which comes preinstalled with Windows OS. But did you know it contains a bug which has not been fixed by Microsoft yet. This bug exists in almost all Windows versions including Windows XP, Vista, 7 and Windows 8.
The bug appears when you try to calculate following:
sqrt(4)-2
If you can't understand the above mentioned equation, lets describe it in details. The above command first calculates Square root of 4 and then subtracts 2 from the result.
Square root of 4 is 2 and when we subtract 2 from it, the end result should be 2-2=0 but Calculator shows a long series of numbers in the result.
If you use the Standard mode of Calculator, the result would be displayed as -1.068281969439142e-19 and if you use Scientific mode, you'll get the result as -8.1648465955514287168521180122928e-39 as shown in following screenshot:

Its definitely a bug in Calculator. You might get different result in different Windows versions but the result will never be correct i.e. 0.
Following video shows the bug live in action:
The only reason behind this bug which I can figure out might be the way computer calculates square root. The square root of 4 is calculated as 1.9999..... up to infinite by computer and it shows the result as 2 using the round off mechanism. And when we subtract 2 from the result, it actually subtracts it from 1.9999..... up to infinite and shows the big series of numbers in minus.
Anyway after all the facts or assumptions, its definitely a bug similar to Notepad bug which also exists in all Windows versions:
Notepad Statusbar Bug Found in All Windows Versions
Thanks to our reader "Anish Mehta" for sharing this bug...
Posted by: Vishal Gupta | Categories: Windows 7, Windows 8, Windows Vista, Windows XP
Tito
Not only this, (root of 16)-4 also not equal to 0 ;)
VG
^^ Absolutely. It seems the bug only appears when the number to be subtracted is equal to the resulting number.
SCBright
It's a round problem for sure, if you calculate int(sqrt(4))-2 the result will be zero.
macpro622776
There's a typo in the article: "Its definitely a bug in Calculator. You might get different result in different Windows versions but the result will never we correct i.e. 0.", it should be "never be correct".
Other than that, interesting find.
cclloyd
Even with parntheses, it doesn't get it right.
Rtyh-12
But 1.9999999... to infinity is equal to two. That should make no difference, so there must be another explanation.
Randy Collins
sqrt(2)- sqrt(2) shows a perfect zero, hence there cannot be any bug
V!3
My maths is weak.....lol
ticomfreak
I get the same bug in the default Windows Phone calculator too. Haha.
Uewd
Faced exactly the same thing in Windows 8 CP 64-bit. Great find. :D
SMBR
I know this bug is firstly seen in Youtube Video, User Name: wizaryan
NSDCars5
Knew it long ago. Saw some "Windows XP Tricks" video, and XP showed like -2.042 etc. BTW, that was SP2. SP3 is same as Win7.
Fernozzle
-8.1648465955514287168521180122928e-39 is another way to write -0.0000000000000000000000000000000000000081648465955514287168521180122928.
THIRTY-NINE zeros! I'd say that that's accurate enough for most cases.
James
It's not really a bug.
The calculator uses float data-type to manage the values. So, the numbers that "never ends" are never exact. The reason why it uses floats, is for efficiency. This "bug" exists in many advance calculators that you buy at the store, and under Windows, it existed possibly well before Windows 95.
IBM has a page on that:www-01.ibm.com/support/docview.wss?uid=swg21608991
Kent Willard
The "bug" also appears in the calculator of Windows XP, which is a pretty lousy trig calculator - it has *NO* square root, sin, cos, etc. buttons. To compute the square root of a value you have to raise to a decimal- fraction exponent:
Sqrt(4) has to be entered as 4 ^ 2 [1/x] = and displays "2"... then subtract 2 and you get
-8.1648465955514287168521180122928e-39
same result as shown in the published example.
Kitten S.
That is so strange!!!! I did this using Windows XP Calc and it just showed up with that. Did it with a REAL calculator and it totalled zero and not -8.16484etc.