#include <stdio.h>
int test1(int x, int n){
int times=31/n;
return ((1-(1<<(n*times)))/(1-(1<<n)));
}
I am doing a calculation where 1<=n<=32
It only works when 1<=n<=31, how can I change it for n=32? As I test its n=32 case in xcode, it triggers the debugger and shows thread 1 exc_arithmetic(code=exc_i386_div....
Thank you in advance.