All pastes #756803 Raw Edit

Untitled

public text v1 · immutable
#756803 ·published 2007-10-31 19:18 UTC
rendered paste body
float mySqrt(float, int *);

int main () {
   int counter = 0;
   float val;
   
   /* some code goes here */

   print("value returned: %f, loops: %d", mySqrt(val, &counter), counter);

   /* ... */
}

/* ... */

float mySqrt(float val, int *cnt) {

   /* count loops like that: *cnt = *cnt + 1;

   return root; /* the root we are looking for */
}