0.99999... != 1

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

ok........the answer is 0.99999... != 1.

simple.

if it were the same, then it would be written the same.

alright...............so....same thing, different numbers:
0.3333...... and 0.4
0.3333..... == 3/9 or 1/3. 0.4 is not 1/3. 0.4 is 2/5.
now....
make fractions...set them equal...cross multiply...... and you get: 30 = 36. that doesn't work. so, no. 0.9999... and 1 are not equal
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post by Tyler »

piranha wrote:ok........the answer is 0.99999... != 1.

simple.

if it were the same, then it would be written the same.

alright...............so....same thing, different numbers:
0.3333...... and 0.4
0.3333..... == 3/9 or 1/3. 0.4 is not 1/3. 0.4 is 2/5.
now....
make fractions...set them equal...cross multiply...... and you get: 30 = 36. that doesn't work. so, no. 0.9999... and 1 are not equal
Imbesile... go get a Degree in Maths and then attempt to discuss it when you learn that it is accepted that 0.99... is equal to 1. For the record there is not an infinetly small different between 0.33... and 0.4 obviously.
Zekrazey1
Member
Member
Posts: 37
Joined: Sat Mar 10, 2007 8:28 am

Post by Zekrazey1 »

'Imbecile'

:P
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post by Tyler »

Yeah i never said i wasn't also an idiot... :P
anon19287473
Member
Member
Posts: 97
Joined: Thu Mar 15, 2007 2:27 pm

Post by anon19287473 »

I maintain that it does not equal one, it WOULD equal 0.0(repeated)1, except that this cannot exist, becuase the 1 would never be reached, the zero's go forever.

So i propose an imaginary number to represent 1-0.99999999999....., it will be a 'w' with a big swoosh at the end! Who's with me?!


A simple explanation... (*partially joking*)

'a' != 'b'
1 != 2
1.9 != 2
'a' != 2
'a' == 'a'
0.99999 != 1
1 == 1
0.9999 == 0.9999

THEY'RE BOTH DIFFERENT CONSTANTS..... THEY CANNOT BE EQUAL!!!!!
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

"Unfortunately", the links quoted in this thread indicate otherwise.
Every good solution is obvious once you've found it.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

This argument has probably been posted before but I can't be bothered to go back through the post to check:

If two numbers are different then there has to be a number between them.

Can anyone suggest a number between 0.999999.... and 1?

Thought not.
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post by Tyler »

jnc100 wrote:This argument has probably been posted before but I can't be bothered to go back through the post to check:

If two numbers are different then there has to be a number between them.

Can anyone suggest a number between 0.999999.... and 1?

Thought not.
Yeah you don't even need Degree level maths... why not go to school and learn some simple maths like calculus?
Zekrazey1
Member
Member
Posts: 37
Joined: Sat Mar 10, 2007 8:28 am

Post by Zekrazey1 »

jnc100 wrote:This argument has probably been posted before but I can't be bothered to go back through the post to check:

If two numbers are different then there has to be a number between them.

Can anyone suggest a number between 0.999999.... and 1?

Thought not.
What's between the numbers 1 and 2 in the set of integers? :P.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

Sorry, should have specified real numbers.

Actually, for some number systems then there is a difference between 0.999... and 1 (see Wikipedia article cited above).

Regards,
John.
Zekrazey1
Member
Member
Posts: 37
Joined: Sat Mar 10, 2007 8:28 am

Post by Zekrazey1 »

Ya, I was just being cheeky ;).
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

I thought this i a general known issue:

in mathmatics 0.9999999.. != 1 and in computerscience 0.9999999.. == 1.

mainly because of a design flaw of the floating point unit.

hence the conditional checks for small deltas

Code: Select all

#define DELTA  0.0000000001 // or something similar small
if(((f1 -f2) < DELTA) || ((f1 -f2) < -DELTA)) {
    //- floats are near enough
}
Author of COBOS
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Post by Brendan »

Hi,
os64dev wrote:in mathmatics 0.9999999.. != 1
No.

0.9999999.. == 1

It's easy to prove too:

1 == 1
1 == 3/3
1 == 3 * (1/3)
1 == 3 * (0.3333...)
1 == 0.999...
os64dev wrote:and in computerscience 0.9999999.. == 1.

mainly because of a design flaw of the floating point unit.

hence the conditional checks for small deltas
The checks for small deltas are needed because of lack of precision, which in turn is caused by a finite number of bits used to store the significand. It's not a "flaw" in the design of the floating point unit (and SSE) - it's just a natural/unavoidable consequence of trying to store large things in small places.

The most common problem is that CPUs work in binary and some decimal numbers can't be represented precisely in binary. For example, "0.1" in binary repeats forever (it becomes 0.0001100110011001100110011...), so the CPU will either truncate it or round it to make it fit. This means that "(1 / 10) * 10" might give the answer 1.00000000000001 because the intermediate value "1 / 10" can't be represented precisely.

In the same way, for "(1 / 3) * 3" the CPU might calculate "1 / 3" as 0.33333333333 (not recurring) and then decide that the final answer is 0.99999999 (also not recurring), which is wrong because of precision loss. If the multiplication was done first then the CPU would give the correct answer (you could even get the correct answer using integers in this case).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Code: Select all

a = b
a2 = ab
a2 - b2 = ab-b2
(a-b)(a+b) = b(a-b)
a+b = b
b+b = b
2b = b
2 = 1
I'm sure that most of you have seen this before - spot the mistake :D
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

AJ wrote:

Code: Select all

a = b
a2 = ab
a2 - b2 = ab-b2
(a-b)(a+b) = b(a-b)
a+b = b
b+b = b
2b = b
2 = 1
Thanks for reminding me to put that on some public blackboard. :twisted:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply