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: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
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'
I'm not crazy, my mother had me tested.

Offline

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

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Windows Calculator Bug

Hi;

It is not a bug.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

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

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
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'
I'm not crazy, my mother had me tested.

Offline

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

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

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.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

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

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
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'
I'm not crazy, my mother had me tested.

Offline

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

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

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
The knowledge of some things as a function of age is a delta function.

Offline

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

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

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.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

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

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
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'
I'm not crazy, my mother had me tested.

Offline

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

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

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.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

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

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

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
The knowledge of some things as a function of age is a delta function.

Offline

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

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

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.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

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

Mathegocart
Member
Registered: 2012-04-29
Posts: 2,226

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


The integral of hope is reality.
May bobbym have a wonderful time in the pearly gates of heaven.
He will be sorely missed.

Offline

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

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

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.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

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

Mathegocart
Member
Registered: 2012-04-29
Posts: 2,226

Re: Windows Calculator Bug

bobbym wrote:

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

Thats Funny.dizzydizzydizzy


The integral of hope is reality.
May bobbym have a wonderful time in the pearly gates of heaven.
He will be sorely missed.

Offline

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

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
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'
I'm not crazy, my mother had me tested.

Offline

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

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

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.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

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
Administrator
Registered: 2010-06-20
Posts: 10,010

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


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

Board footer

Powered by FluxBB