summaryrefslogtreecommitdiff
path: root/example/libfib/fib.c
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-03-06 21:21:55 -0500
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-03-06 21:21:55 -0500
commitca915283cb63068f2fb6bb03ec8faf9c97d009d0 (patch)
treebc5afadab2c2bb28a9fa005d77a27c567276c449 /example/libfib/fib.c
parent5dd9182100f7ded42cab29ee5d556b88d818ee35 (diff)
feat: templates for libs
Added GNU Makefile templates for quick building programs, static libraries, & shared libraries.
Diffstat (limited to 'example/libfib/fib.c')
-rw-r--r--example/libfib/fib.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/example/libfib/fib.c b/example/libfib/fib.c
new file mode 100644
index 0000000..707215d
--- /dev/null
+++ b/example/libfib/fib.c
@@ -0,0 +1,11 @@
+#include "fib.h"
+
+uint64_t fib(const uint64_t n) {
+ if (n <= 0) {
+ return 0;
+ } else if (n == 1) {
+ return 1;
+ }
+ return (fib(n - 1) + fib(n - 2));
+}
+