2011-11-29, 07:27 PM
I did print out up to the 15th decimal place. Also note how on the Before-After check, x was printed without any formatting, so perhaps the fprintf function did the truncating itself.
But anyway, I got it working with
while (x - limit > 10^(-15))
so I'm assuming it's just some nuances with binary representation of numbers.
The question now is how do I know beforehand that something this simple (decrement step by 0.1) is going to run into this problem? Should I always do the (different > epsilon) check instead of (difference = 0) check?
But anyway, I got it working with
while (x - limit > 10^(-15))
so I'm assuming it's just some nuances with binary representation of numbers.
The question now is how do I know beforehand that something this simple (decrement step by 0.1) is going to run into this problem? Should I always do the (different > epsilon) check instead of (difference = 0) check?

