Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2013-05-23 01:42:08

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 17,173
Website

Windows Calculator Bug

1. Open calculator.
2. Enter a square number like 25.
3. Click on the square root button in the     calculator.
4. Now subtract the result from the square     root of the number, in this case 5.
5. Click '=' button on the calculator and     note that the result is not 0.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

#2 2013-05-23 01:48:28

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 87,238

Re: Windows Calculator Bug

Hi;

It is not a bug.


In mathematics, you don't understand things. You just get used to them.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#3 2013-05-23 02:09:01

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 17,173
Website

Re: Windows Calculator Bug

Is it a different way of expressing Zero?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

#4 2013-05-23 02:10:36

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 87,238

Re: Windows Calculator Bug

First congratulations, half a zillion programmers will never know that in their entire life! A zillion math types do not believe it! They suspect that big bad Mi**8cr---o$--oft is at it again. For once they are not to blame.


In mathematics, you don't understand things. You just get used to them.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#5 2013-05-23 02:40:35

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 17,173
Website

Re: Windows Calculator Bug

If it not a bug, whats it?

I didn't understand what you're talking of


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

#6 2013-05-23 02:43:28

anonimnystefy
Real Member
From: The Foundation
Registered: 2011-05-23
Posts: 15,544

Re: Windows Calculator Bug

Isn't this the precision stuff you always mention, bobbym?


“Here lies the reader who will never open this book. He is forever dead.

“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

Offline

#7 2013-05-23 02:49:20

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 87,238

Re: Windows Calculator Bug

Isn't this the precision stuff you always mention, bobbym?

Computer math ≠ human math

Okay, first you must get the spiel.

The hardest thing for computers to do is arithmetic. People find that amazing but it is true. The problem is not a bug but it is inherent in the way computers do arithmetic.

1) To a computer the number line is not solid like they draw it in mathematics. Instead it looks like the dots and dashes of morse code. This is because some numbers do not exist for a computer. For instance there is no 1 / 3 on its number line, just a big hole.

2) (a - b)(a+b)≠(a^2 - b^2). Algebraically equal expressions are not equal to a computer.

3) Addition is not commutative.

The order of addition can drastically affect the answer!

4) A computer can not subtract or multiply without possible disastrous error.

5) You never use the quadratic formula to solve a quadratic equation because on a computer it will give inaccurate results.

6) Newton's iteration though taught is rarely the best one for the job.

7) A computer can not compare theoretically equal quantities.

and many more.


In mathematics, you don't understand things. You just get used to them.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#8 2013-05-23 03:43:15

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 17,173
Website

Re: Windows Calculator Bug

So, Is it possible that human beings will eventually develop something better?

5) You never use the quadratic formula to solve a quadratic equation because on a computer it will give inaccurate results.

Would you give an example?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

#9 2013-05-23 03:50:50

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 87,238

Re: Windows Calculator Bug

Hi Agnishom;

Yes, we could come up with something better. A human brain! But I think that has already been made.

Here is a whole bunch of examples that I worked on for MIF:

http://www.mathisfunforum.com/viewtopic … 82#p173482


In mathematics, you don't understand things. You just get used to them.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#10 2013-05-23 04:08:11

anonimnystefy
Real Member
From: The Foundation
Registered: 2011-05-23
Posts: 15,544

Re: Windows Calculator Bug

I remember the problem on calculating sqrt(3.0000000000000001)-sqrt(3) you posed. Everything gives out 0 when the expression is evaluated directly, even M!


“Here lies the reader who will never open this book. He is forever dead.

“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

Offline

#11 2013-05-23 04:12:59

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 87,238

Re: Windows Calculator Bug

Yes, without taking special pains on that one, subtractive cancellation will wipe out the answer.


In mathematics, you don't understand things. You just get used to them.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#12 2013-05-25 04:50:37

mathgogocart
Member
Registered: 2012-04-29
Posts: 1,426

Re: Windows Calculator Bug

Agnishom wrote:

1. Open calculator.
2. Enter a square number like 25.
3. Click on the square root button in the     calculator.
4. Now subtract the result from the square     root of the number, in this case 5.
5. Click '=' button on the calculator and     note that the result is not 0.

they have a bug smile


Hey.

Offline

#13 2013-05-25 04:52:43

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 87,238

Re: Windows Calculator Bug

One way or another all math programs will do this, even Mathematica.


In mathematics, you don't understand things. You just get used to them.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#14 2013-05-25 04:57:35

mathgogocart
Member
Registered: 2012-04-29
Posts: 1,426

Re: Windows Calculator Bug

bobbym wrote:

One way or another all math programs will do this, even Mathematica.

Thats Funny.dizzydizzydizzy


Hey.

Offline

#15 2013-05-25 12:50:01

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 17,173
Website

Re: Windows Calculator Bug

And sad....


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

#16 2013-05-25 15:30:33

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 87,238

Re: Windows Calculator Bug

Hi Agnishom;

It is a property of how computers and mathematics mix. Once you know about it you are prepared. We will go over it when the the time comes.


In mathematics, you don't understand things. You just get used to them.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#17 2013-06-10 18:40:12

philandy
Member
Registered: 2013-06-10
Posts: 11

Re: Windows Calculator Bug

If you had to use binary, decimal, and floats all at the same time, you might come up with sqrt(4)-2=-8.1648465955514287168521180122928e-39 as well. Notice the sqrt(1)-1 is fine. Personally I prefer to use the Google Dual-Mode Calculator app in Google mode, which gives sqrt(4)-2=0.

Offline

#18 2013-06-10 19:24:07

bob bundy
Moderator
Registered: 2010-06-20
Posts: 6,426

Re: Windows Calculator Bug

hi

It's not a bug.  It is just that calculators and computers can only do arithmetic imperfectly.  Numbers are represented at machine code level by binary numbers.  All fractions that do not have a power of two as the denominator have a  recurring binary form.  Since no machine can hold an infinite number of binary digits, it is inevitable that the representation will involve some sort of truncation of the true value.  This leads to tiny errors between the value calculated and the true answer.

In the early days of calculators it was much more common to find such errors arising.  Two things (at least two; there must be more that I don't know about) can improve the situation.  (i) Increase the number of binary digits used to represent the number; (ii) use guard digits.  The latter means that more digits are used than are displayed.  The guard digits are used to round off the displayed results.  This eliminates a lot of the problem.

On a calculator you can reveal the guard digits by doing a sum and then subtracting the displayed answer from itself.  The difference is the guard.  If rounding up has occurred you need to adjust what you see displayed by one to allow for the rounding. 

Bob


You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

Board footer

Powered by FluxBB