rubyx/test/bench/c/adds.c

28 lines
339 B
C
Raw Normal View History

#include<stdio.h>
int fibo(int n){
int result;
int a = 0;
int b = 1;
int i = 1;
while( i < n )
{
result = a + b;
a = b;
b = result;
i++;
}
return result;
}
int main(void)
{
int counter = 98304 + 1696;
int counter2 = counter;
2015-11-20 18:12:13 +01:00
int level = 40;
int fib ;
2015-11-20 18:12:13 +01:00
while(counter--) {
fib = fibo(level);
}
}