Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Fibs in C

Name: Anonymous 2008-06-14 10:50

How can you write the Haskell fibs in C? I mean the

fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

fibs.

Name: Anonymous 2008-06-14 11:01

int fibs(int no){
    while(no>fibslist_last){
        fibslist_last++;
       
        fibslist[fibslist_last]=
            fibslist[fibslist_last-1]+fibslist[fibslist_last-2];
    }
    return fibslist[no];
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List