[Did You Know] Classic Square Root Bug Fixed in Calculator in Windows 10

SUMMARY: The classic square root bug (√4 – 2 != 0) has been fixed in Calculator in Windows 10 newer versions.

Let me admit I completely forgot about posting this article. When Microsoft released Windows 10 Insider Preview build 17639, the good ol’ classic square root bug was fixed in Calculator app. I mentioned it at that time in our exclusive Windows 10 RS5 build changelog topic. Check out “Windows 10 Build 10.0.17639 Changelog” section in following article:

[Changelog] What’s New in Windows 10 October 2018 Update (Version 1809)

Advertisement

Yesterday an AskVG reader contacted me and asked me why didn’t I post about this important change in Windows 10? He reminded me about following very old article which I posted long time back in 2012 and many other people and websites confirmed this bug:

Microsoft Windows Calculator Bug, Sqrt(4) – 2 != 0

The above mentioned link contains details about the Calculator bug which was present in almost all Windows versions including Windows XP, Vista, Windows 7, Windows 8/8.1 and Windows 10.

The bug is about calculating square root of perfect squares such as 4. Perfect squares are integers which are squares of other integers. If we calculate √4 and then subtract 2, the result should be 0 but Calculator used to display -1.068281969439142e-19 as the result.

Windows_Calculator_Bug.png

Finally Microsoft acknowledged this good ol’ bug in Calculator app and they fixed it in Windows 10 newer versions.

Microsoft said:

Advertisement

Windows Calculator has been updated to now correctly calculate square roots for perfect squares (integers that are squares of other integers). Because of the arbitrary precision arithmetic library used by the Calculator app, the square root calculation is an approximation calculated using the Exponential Identity function.

Previously, when you would calculate the square root of 4, the result would be 1.99999999999999999989317180305609 which would be rounded to 2 when displayed, because we calculated enough digits to do the rounding correctly. However, as soon as you subtract 2, you would see the remaining digits.

After this update, the square root calculation now recognizes perfect squares and correctly returns exactly 2 for the square root of 4.

PS: You can check out following video which was posted in 2012. It shows the Calculator bug live in action:

Now the bug has been fixed and Calculator calculates square roots of perfect squares perfectly.

Published in: Windows 10

About the author: Vishal Gupta (also known as VG) has been awarded with Microsoft MVP (Most Valuable Professional) award. He holds Masters degree in Computer Applications (MCA). He has written several tech articles for popular newspapers and magazines and has also appeared in tech shows on various TV channels.

Comments

NOTE: Older comments have been removed to reduce database overhead.

  1. Grace a Dieu! That square root bug was driving me c.zy. Every time I wanted to get a square foot it ended up being wacky. Frustration over this caused me to go back to smoking again, and that’s bad.

Leave a Comment

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

NOTE: Your comment may not appear immediately. It'll become visible once we approve it.