I'm not sure that code can prove it; you're asking the machine to deal with numbers to infinite precision. As soon as you start hitting floating point limits, you can no longer trust the numbers.

If you want to make 0.999 become 1 then you use ".round ". Else f you want prove it mathematically then try this http://en.wikipedia.org/wiki/Limit_(mathematics). Write your code for this equation. I never try. XD

No 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)

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.

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...