|
|
1.1 ! root 1: long int pow_ii(ap, bp) ! 2: long int *ap, *bp; ! 3: { ! 4: register long int pow, x, n; ! 5: ! 6: pow = 1; ! 7: x = *ap; ! 8: n = *bp; ! 9: ! 10: if(n > 0) ! 11: { ! 12: if (x == 0) ! 13: return(0); ! 14: ! 15: for( ; ; ) ! 16: { ! 17: if(n & 01) ! 18: pow *= x; ! 19: if(n >>= 1) ! 20: x *= x; ! 21: else ! 22: break; ! 23: } ! 24: } ! 25: else ! 26: if (n < 0) ! 27: { ! 28: if ((x > 1 ) || (x < -1)) ! 29: return(0); ! 30: } ! 31: return(pow); ! 32: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.