how do I increment a number in C?

I don’t know where my brain was the first time this thread saw the light, but only on re-reading did I realize that ultrafilter’s entry in post number 7++ is guaranteed non-terminating for any argument other than 0. As, I presume, it was meant to be.

It would be, if you weren’t dealing with limited-precision integers. Keep subtracting 1 from -1, and you’ll end up at 0 eventually.

I knew, I knew I was being wooshed. Thanks, Chronos. My brain was about to explode.

But it still wouldn’t terminate. At that point, you’d then have to evaluate increment(increment(0)). OK, increment(0) can be evaluated easily enough, but then you’re left with increment(1), which resolves to… increment(1).

I suppose that if we’re talking about finite, non-idealized machines, eventually you’ll have too many levels of recursion and run out of stack. So it’d terminate with an error message. It still wouldn’t give correct output for any nonzero input, though.