some new things, mostly not working or finished

This commit is contained in:
2025-11-08 18:16:10 +01:00
parent 5792bfbd9a
commit 795fb42900
30 changed files with 4789 additions and 1 deletions

22
fib/sfib.c Normal file
View File

@@ -0,0 +1,22 @@
#include <stdio.h>
typedef unsigned long long U;
U fib(int n) {
if (n < 2) return n;
U a = 1, b = 1, c = 1, d = 0, x = 1, y = 0, z = 0, w = 1, t;
while (n) {
if (n & 1) {
t = x * a + y * c; y = x * b + y * d; x = t;
t = z * a + w * c; w = z * b + w * d; z = t;
}
t = a * a + b * c; b = a * b + b * d; a = t;
t = c * a + d * c; d = c * b + d * d; c = t;
n >>= 1;
}
return x;
}
int main(int argc, char **argv[]) {
for (int i = 0;i < int(argv);i++) printf("%llu ", fib(i));
}