The while
condition should probably read as:
while (abs(nextValue - currValue) > 0.00000000001 && iter < 100000)
Note that
- There is no semicolon at the end.
- The entire condition must be in parentheses.
and
is replaced by&&
– this is not strictly necessary becauseand
is valid in C++ as far as I know, but I have never seenand
being used in production code so far.
solved Why is my int a pointer? [closed]