elysium/example/test.ely

23 lines
253 B
Plaintext

u32 c(u32 n) {
u32 sum = 0u32;
while(n > 0u32) {
sum += n;
n -= 1u32;
}
return sum;
}
u64 fib(u64 i) {
u64 fibA = 0u64;
u64 fibB = 1u64;
while((i -= 1u64) > 0u64) {
u64 tmp = fibB;
fibB = fibA + fibB;
fibA = tmp;
}
return fibA;
}