source: Deliverables/D4.1/GCC/IntegerSquareRoot.c @ 1981

Last change on this file since 1981 was 620, checked in by mulligan, 10 years ago

More changes to presentation. Modified some of the C examples to test for Ayache's reported bug.

File size: 206 bytes
Line 
1unsigned int isqrt(unsigned int n){
2  unsigned int a;
3  for (a = 0; n >= (2 * a) + 1; n -= (2 * a++) + 1);
4  return a;
5}
6
7int main()
8{
9  int i = 0;
10  i = isqrt(16);
11  if(i == 4)
12    return 1;
13  return 0;
14}
Note: See TracBrowser for help on using the repository browser.