Comment by amluto
2 days ago
One can reasonably debate where the Fibonacci sequence starts. Their fib implementation is unquestionably broken for negative inputs, but fortunately they don’t supply negative inputs.
But try reading the code that calls fib. It’s so outrageously wrong that it’s fairly easy to read it and pretend they wrote something sensible. Never mind that there isn’t actually a straightforward single-line fix - next_fib would be an entirely different beast from fib.
If they had started with frequency = 4, the real effect of the code would have been to send a couple pulses and then to spend very rapidly (worse than exponentially) increasing time and stack space trying to compute fib.
I had missed that, thanks. That is whack. (The input to fibonacci() is it's last output.)