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