Fix delivered in the most recent Redstone 5 build

Apr 5, 2018 05:41 GMT  ·  By

Microsoft has finally fixed a decade-old issue in the Windows Calculator that’s widely known as the “square root of perfect square” bug causing incorrect results for certain operations.

Windows 10 Redstone 5 build 17639, which is available at this point for members of the Windows Insider program enrolled in the Skip Ahead ring, is the one bringing this bugfix, with everyone else to get it either when work on the next Windows 10 feature release completes or in the meantime with a Calculator app update.

Specifically, if you want to replicate the bug, launch the Calculator app and try to calculate the square root of 4 and then subtract 2. While the answer should be 0, the Windows Calculator sometimes gives the wrong answer due to what Microsoft claims to be arbitrary precision arithmetic library.

What’s important to know is that the bug doesn’t seem to exist on all systems for one reason or another, though we’ve managed to reproduce the bug on 3 in 4 computers. This means there’s a good chance you’re going to see it as well, but don’t be too surprised if it doesn’t. You can check out the video at the end of the article to show the bug in action.

Also exists in Windows 7 and 8.1

Microsoft’s Raymond Chen published an in-depth analysis of the error in 2016 on the Microsoft Developer page, explaining why exactly the Calculator app returns a different result.

“Even if the value you are taking the square root of happens to be a perfect square, the calculator doesn't realize that. It doesn't try to calculate an integer square root first, and then fall back to the floating point version if the integer square root fails to produce an exact result. It just goes for the square root via the extended precision library,” he explained.

The bug has been around for many years, and one report was posted on Microsoft’s Community forums in 2010 when the current version of Windows was Windows 7. Given that the library used by the Calculator didn’t change, the bug is still there in Windows 8.1 and Windows 10.