X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/c4ccbbf992e1587ae316f66af6a28006780688d8..289651a7df7bc48724137cd0faaf8535fb54e73b:/test/example/example.h diff --git a/test/example/example.h b/test/example/example.h index b3cdee8..ecbaa6b 100644 --- a/test/example/example.h +++ b/test/example/example.h @@ -34,6 +34,7 @@ /*----- Header files ------------------------------------------------------*/ +#include #include /*----- Functions provided ------------------------------------------------*/ @@ -47,6 +48,22 @@ extern int greet(char */*buf*/, size_t /*sz*/, const char */*name*/); * Return zero on success, or -1 on error. */ +extern unsigned long recfib(unsigned /*n*/); + /* Stupid but traditional recursive Fibonacci. */ + +extern unsigned long iterfib(unsigned /*n*/); + /* Slightly less stupid but still traditional iterative Fibonacci. */ + +extern unsigned long expfib(unsigned /*n*/); + /* Sadly nontraditional intelligent Fibonacci. */ + +#define RECFIBLIMIT 40 /* too slow beyond this */ +#if (ULONG_MAX/65536 >> 16) >= 0xffffffff +# define FIBLIMIT 94 /* F_94 = 19740274219868223167 > 2^64 */ +#else +# define FIBLIMIT 48 /* F_48 = 4807526976 > 2^32 */ +#endif + /*----- That's all, folks -------------------------------------------------*/ #ifdef __cplusplus