Hacker News new | past | comments | ask | show | jobs | submit login

GCC can even eliminate non-tail recursion, such as with this piece of black magic:

    int factorial(int x) {
       if (x > 1) return x * factorial(x-1);
       else return 1;
    }
will be optimized by GCC to

    int factorial(int x) {
       int result = 1;
       while (x > 1) result *= x--;
       return result;
    }
(http://ridiculousfish.com/blog/posts/will-it-optimize.html)



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: