Annotation of 42BSD/usr.lib/libF77/pow_hh.c, revision 1.1

1.1     ! root        1: /*
        !             2:  *     "@(#)pow_hh.c   1.1"
        !             3:  */
        !             4: 
        !             5: short pow_hh(ap, bp)
        !             6: short *ap, *bp;
        !             7: {
        !             8: short pow, x, n;
        !             9: 
        !            10: pow = 1;
        !            11: x = *ap;
        !            12: n = *bp;
        !            13: 
        !            14: if(n < 0)
        !            15:        { }
        !            16: else if(n > 0)
        !            17:        for( ; ; )
        !            18:                {
        !            19:                if(n & 01)
        !            20:                        pow *= x;
        !            21:                if(n >>= 1)
        !            22:                        x *= x;
        !            23:                else
        !            24:                        break;
        !            25:                }
        !            26: return(pow);
        !            27: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.