heyyy guysss....just trying to make a code to proove .999=1

any ideass?? :))

ty!!

Jump to PostIdk if this works but maybe try out using this algebra:

`1/9 = 0.1111.... 9 * 1/9 = 9 * 0.1111 1 = 0.999....`

See if you get similar result on a computer.

Jump to PostNo it is True with repeating decimal 9 of infinite precicion see previous post proving it simply and elegantly with 1 / 9 *9 (same could be done with decimal reprecentation of any number with inverse with repeating decimals)

Jump to PostHere's a nice video about it, which I recently stumbled upon.

Moschops
683
Practically a Master Poster
Featured Poster

Edited
by Moschops because:
*
n/a *

Eagletalon
34
Junior Poster in Training

.round?

murnesty
0
Junior Poster in Training

TrustyTony
888
pyMod
Team Colleague
Featured Poster

In my computer it takes 16 iterations from 0.9 to reach floating point limit of accuracy, if you mean that:

```
1 0.99
2 0.999
3 0.9999
4 0.99999
5 0.9999990000000001
6 0.9999999
7 0.9999999900000001
8 0.999999999
9 0.9999999999
10 0.99999999999
11 0.999999999999
12 0.9999999999999001
13 0.99999999999999
14 0.999999999999999
15 0.9999999999999999
16 1.0
```

The code was not in C++, but results should be similar in C++.

mrnutty
761
Senior Poster

Idk if this works but maybe try out using this algebra:

```
1/9 = 0.1111....
9 * 1/9 = 9 * 0.1111
1 = 0.999....
```

See if you get similar result on a computer.

Anirudh Rb
0
Newbie Poster

No code can do that..it's a totally crazy idea. I'd love to know if you find a way to do that.

doug65536
18
Light Poster

Not sure how you plan to write a program to prove that, since you already know it's false.

TrustyTony
888
pyMod
Team Colleague
Featured Poster

Edited
by TrustyTony because:
*
n/a *

NicAx64
76
Posting Pro

I'm not sure are you looking this?

LHS= .9999*

= ( 1.0 - 0.0*****1 )

= 1.0 - lim[n->infinity] 1/n

= 1.0 - 0

= 0

.: LHS = RHS

so proving this using code is simple. So you need a Automated Theorm Proving

math engine and in font end you can fetch the following rules.

Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster

TrustyTony
commented:
Good clear maths link
+13

doug65536
18
Light Poster

I didn't see anything saying that the OP was asking to prove that 0.999<repeating> was equal to 1.0. The OP says, prove that 0.999 (which I interpreted as exactly 0.999 as in 0.999000).

Is this a sinister puzzle given by a computer science teacher or something? If so, I believe I see the trick to it.

The puzzle probably wants you to realize that floating point numbers are typically stored with a mantissa and an exponent. What I believe the puzzle is looking for is you to come up with a floating point representation format where the mantissa doesn't have enough bits to store 0.999 - the closest representation would be 1.0.

Eagletalon
commented:
Good logic and well writeen answer with a start to solving it
+1

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.

Broken Link

**You're trying to visit a URL that doesn't currently exist on the web.**
Most likely, a member posted a link a long time ago to a web page that has since been removed.
It's also possible that there was a typo when posting the URL.
We redirect you to this notice instead of stripping out the link to preserve the integrity of the post.