954,307 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Microsoft Calculator tweak

I just saw the forum title and remembered one of the Microsoft Calculator tweak.
I think all of you know this silly Microsoft tweak ( i can say negligence).

Open windows calculator. (Whatever may be windows version..works for all)

Now.

find squareroot(3)-3

Guess what............

The answer is not 0.


It's ok that microsoft neglected that error. But what made me suprised and shocked is that they never fixed that bug in any of the version of windows starting from sp1 to latest windows 7. (dint tried in windows 8. i think the bug is not fixed in 8 also :)).
----------------------

Ideas , comments and views....

harinath_2007
Posting Whiz
355 posts since Aug 2010
Reputation Points: 78
Solved Threads: 36
 

sounds more like a bug than a tweek

caperjack
I hate 20 Questions
Team Colleague
13,069 posts since Aug 2003
Reputation Points: 1,064
Solved Threads: 812
 

Yes. It looks like negligence to me(not fixed in any of versions)
And..

find squareroot(3)-3


correction of small typo.:) it is squareroot(9)-3
Works for other values also like..
squareroot(16)-4
squareroot(25)-5
squareroot(36)-6
......

harinath_2007
Posting Whiz
355 posts since Aug 2010
Reputation Points: 78
Solved Threads: 36
 

It's the same "problem" as the other user who posted a similar "problem". The problem is that you do not understand how computers store and process floating point numbers. The square root function uses a floating point algorithm. The square root of 9 is not (according to the algorithm) exactly 3. It is 3 plus 1.155e-37. Because the decimal part is so small compared to the integer part it it not displayed. However, when you subtract 3 you are left with only the decimal part which can be displayed in scientific notation. I suppose the original answer could have been displayed as 4 + 1.155e-37 but that would be silly.

Reverend Jim
Posting Shark
Moderator
1,161 posts since Aug 2010
Reputation Points: 253
Solved Threads: 158
 

I believe the actual algorithm is Newton's method. You start with a guess as to the answer then iterate through a formula to get the next approximation. Repeat as needed. It converges very quickly to the answer.

Example - find the square root of 10. Let's guess that it is 2 (it's not a good guess but it doesn't matter). To find the next approximation we divide the original number by our guess, add it to our guess then divide the result by 2.

(2 + 10/2) / 2 = 3.5
3.5 squared is 12.25

(3.5 + 10/3.5) / 2 = 3.178571429
3.178571429 squared is 10.10331633

(3.178571429 + 10/3.178571429) / 2 = 3.162319422
3.162319422 squared is 10.00026413

etc. Each iteration gets us closer to the actual square root. All of it requires floating point arithmetic.

Reverend Jim
Posting Shark
Moderator
1,161 posts since Aug 2010
Reputation Points: 253
Solved Threads: 158
 
It's ok that microsoft neglected that error. But what made me suprised and shocked is that they never fixed that bug in any of the version of windows starting from sp1 to latest windows 7.

That is incorrect!!

Im on Win98se and when i do a square root of 3 find i get the correct response

1.73205080756887729352744634150587

The Dude
Nearly a Senior Poster
3,485 posts since Dec 2005
Reputation Points: 1,054
Solved Threads: 31
 

That's because the OP got the numbers wrong. He/she meant to enter 9, then take the square root, then subtract 3. This has been posted elsewhere.

Reverend Jim
Posting Shark
Moderator
1,161 posts since Aug 2010
Reputation Points: 253
Solved Threads: 158
 

OK i just got the square root of 9 which is 3

Then i hit - (Minus sign) and hit 3 and i got this answer

4.2133833890964759959853688320845e-38

The Dude
Nearly a Senior Poster
3,485 posts since Dec 2005
Reputation Points: 1,054
Solved Threads: 31
 
That's because the OP got the numbers wrong. He/she meant to enter 9, then take the square root, then subtract 3. This has been posted elsewhere.

@Reverend Jim is correct . It's a typo.That was actually squareroot(9)-3 . I corrected that in my next post.(see my above post)correction of small typo. it is squareroot(9)-3
Works for other values also like..
squareroot(16)-4
squareroot(25)-5
squareroot(36)-6
......

harinath_2007
Posting Whiz
355 posts since Aug 2010
Reputation Points: 78
Solved Threads: 36
 

Hehehe i dont understand :D

The Dude
Nearly a Senior Poster
3,485 posts since Dec 2005
Reputation Points: 1,054
Solved Threads: 31
 

Asked and answered twice. I'm not going to explain it again.

Reverend Jim
Posting Shark
Moderator
1,161 posts since Aug 2010
Reputation Points: 253
Solved Threads: 158
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: