I have the following code, and I want it to give me factorial values up to 20.
-(NSUInteger)factorialofNumber(NSUInteger n){
static NSUInteger f[N + 1];
static NSUInteger i = 0;
if (i == 0)
{
f[0] = 1;
i = 1;
}
while (i <= n)
{
f[i] = i * f[i - 1];
i++;
}
return f[n];
}
The issue is that when this executes, all values above 12 are incorrect. I have placed this in my prefix file to try and have larger values available but it hasn't fixed the problem. Any hints to work around this?
#define NS_BUILD_32_LIKE_64 1