Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Recursive fibonacci benchmark using top languages on GitHub. Parent comment
int foo(int x) { if (test(x)) return C; return evaluate(x) + foo(adjust(x)); }
int foo(int x) { int accum = C; for ( ; !test(x); x = adjust(x)) { accum += evaluate(x); } return accum; }
int fib(int x) { int accum = 1; for (; x > 1; x -= 2) { accum += fib(x - 1); } return accum; }
And this idiom is recognized by both gcc and llvm. In fact. llvm has a test that specifically makes sure fib is transformed as thus: https://github.com/llvm-mirror/llvm/blob/30fa583f8430bfc7935...
There are no comments on this comment yet.
And this idiom is recognized by both gcc and llvm. In fact. llvm has a test that specifically makes sure fib is transformed as thus: https://github.com/llvm-mirror/llvm/blob/30fa583f8430bfc7935...