elysium/example/test.ely

23 lines
253 B
Plaintext
Raw Normal View History

u32 c(u32 n) {
u32 sum = 0u32;
while(n > 0u32) {
sum += n;
n -= 1u32;
}
return sum;
}
2024-04-09 13:57:17 +02:00
u64 fib(u64 i) {
u64 fibA = 0u64;
u64 fibB = 1u64;
while((i -= 1u64) > 0u64) {
u64 tmp = fibB;
fibB = fibA + fibB;
fibA = tmp;
}
return fibA;
}