1: /*
   2:  *	"@(#)pow_ri.c	1.1"
   3:  */
   4: 
   5: float pow_ri(ap, bp)
   6: float *ap;
   7: long int *bp;
   8: {
   9: double pow, x;
  10: long int n;
  11: 
  12: pow = 1;
  13: x = *ap;
  14: n = *bp;
  15: 
  16: if(n != 0)
  17:     {
  18:     if(n < 0)
  19:         {
  20:         if(x == 0)
  21:             {
  22:             return(pow);
  23:             }
  24:         n = -n;
  25:         x = 1/x;
  26:         }
  27:     for( ; ; )
  28:         {
  29:         if(n & 01)
  30:             pow *= x;
  31:         if(n >>= 1)
  32:             x *= x;
  33:         else
  34:             break;
  35:         }
  36:     }
  37: return(pow);
  38: }

Defined functions

pow_ri defined in line 5; never used
Last modified: 1983-05-20
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 268
Valid CSS Valid XHTML 1.0 Strict