Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
getMaxWordLength().... Ben Bacarisse wins!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="jacob navia, post: 5165639"] Le 17/06/2014 01:59, DFS a écrit : :-) Here is the test program: 14 int main(int argc,char *argv[]) 15 { 16 int i,limit; 17 18 if (argc > 1) limit = atoi(argv[1]); 19 else limit = 50; 20 if (limit > 70) { 21 printf("Warning: Results beyond fib(70) are not accurate in the last digits\n"); 22 if (limit > MAXFIB) { 23 printf("Error, max is %d. Results beyond that are wrong\n",MAXFIB); 24 limit = MAXFIB; 25 } 26 } 27 for (i=0; i<limit; i++) { 28 printf("Fib(%d)=%llu\n",i,fib(i)); 29 } 30 return 0; 31 } This executes in 1 ms for input of 70. It calculates each fib from scratch AGAIN! [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
getMaxWordLength().... Ben Bacarisse wins!
Top