So now just add in a counter.
Why are you using such a stupid function? It's just:
Code:void f(int a) {
return a >= 1 ? 1 : a;
}
Printable View
So now just add in a counter.
Why are you using such a stupid function? It's just:
Code:void f(int a) {
return a >= 1 ? 1 : a;
}
How to add counters
Code:int divide(int a)
{
numcalls++;
if (a > 1) {
return divide (a/2);
}
return a;
}
int divide(int a)
{
for( ; a > 1 ; a /=2 ) {
numloops++;
}
return a;
}