Microsoft fixes decade-old bug in calculator

Interesting, it could be another fake news.
Do you know how it handle square root of 9, then subtracting 3?
 
Windows XP calculator gives: -8.1648465955514287168521180122928e-39

I know what floating-point precision is, and that is a subtle error, but quite funny!

Rounding of numbers used to be part of my previous job, and for fun I also worked on the Intel x86 co-coprocessor x87 arithmetic.

The standard for 80-bit double-extended precision is https://en.wikipedia.org/wiki/IEEE_754-1985

P.S. There are some quite amusing comments posted on the article itself (not just this forum thread).

Edit: The article link explains a little more why this error occurs (slightly different from what I thought). Crappy code implementation either way: https://blogs.msdn.microsoft.com/oldnewthing/20160628-00/?p=93765

sqrt(x) = exp(½ ln x) if x > 0
 
Last edited:
I read somewhere the Columbia shuttle crashed because of this error

No manned mission has ever failed due to software errors (Columbia failed due to damage to the thermal shielding).

Many unmanned missions have failed due to software errors. Here is a list of the more famous ones: https://en.wikipedia.org/wiki/List_of_software_bugs#Space

A booster went off course during launch, resulting in the destruction of NASA Mariner 1. This was the result of the failure of a transcriber to notice an overbar in a written specification for the guidance program, resulting in the coding of an incorrect formula in its FORTRAN software. (July 22, 1962).
The Russian Space Research Institute's Phobos 1 (Phobos program) deactivated its attitude thrusters and could no longer properly orient its solar arrays or communicate with Earth, eventually depleting its batteries. (September 10, 1988).
The European Space Agency's Ariane 5 Flight 501 was destroyed 40 seconds after takeoff (June 4, 1996). The US$1 billion prototype rocket self-destructed due to a bug in the on-board guidance software.
In 1997, the Mars Pathfinder mission was jeopardised by a bug in concurrent software shortly after the rover landed, which was found in preflight testing but given a low priority as it only occurred in certain unanticipated heavy-load conditions. The problem, which was identified and corrected from Earth, was due to computer resets caused by priority inversion.
In 2000, a Zenit 3SL launch failed due to faulty ground software not closing a valve in the rocket's second stage pneumatic system.
The European Space Agency's CryoSat-1 satellite was lost in a launch failure in 2005 due to a missing shutdown command in the flight control system of its Rokot carrier rocket.
NASA Mars Polar Lander was destroyed because its flight software mistook vibrations due to atmospheric turbulence for evidence that the vehicle had landed and shut off the engines 40 meters from the Martian surface (December 3, 1999).
Its sister spacecraft Mars Climate Orbiter was also destroyed, due to software on the ground generating commands in pound-force (lbf), while the orbiter expected newtons (N).
A mis-sent command from Earth caused the software of the NASA Mars Global Surveyor to incorrectly assume that a motor had failed, causing it to point one of its batteries at the sun. This caused the battery to overheat (November 2, 2006).
NASA's Spirit rover became unresponsive on January 21, 2004, a few weeks after landing on Mars. Engineers found that too many files had accumulated in the rover's flash memory. It was restored to working condition after deleting unnecessary files.
Japan's Hitomi astronomical satellite was destroyed when a thruster fired in the wrong direction, causing the spacecraft to spin faster instead of stabilize (March 26, 2016)
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X