while trying to compare times between two different ways of determing whether a number is odd/even without using modulo, i thought of using long long int
s which my codeblocks compiler aint supports .
and so i installed pelles c.( supports c99/c11 which inturn supports long long stuff.. )
and im down with linker errors. problems :
- i dont understand much what they are ,
- google led me to some pelles c forum threads where the discussion went above my head ( note : but it was related to the problem i had )
- i tried looking into pelles c help (which is raather nice bdw) but didnt find (didnt know where to look maybe) much.
can someone help me getting these things sorted ?
this is my code :
#include<stdio.h>
#include<time.h>
int main(){
long long int i = 0, y =0 , x = 7985463214932541; // x = a very big odd number
clock_t t1,t2;
printf("starting..\n");
t1 = clock();
for(i = 0 ; i < 500000000 ; i++){
if(x&1) y=1;
}
t1 = clock() - t1;
y=0;
t2 = clock();
for(i = 0; i < 500000000 ; i++){
if(((x/2)*2) != x ) y=1;
}
t2 = clock() - t2;
printf("bitwise time : %15ld\n",t1);
printf("\nmul-div time: %15ld",t2);
return 0;
}
also , while creating a new project in pelles c, i get tons of options as tp the project type , im just lerning c as of now , basic stuff.. so which one should i choose there ??
any help would be immensely appreciated !