Annotation of researchv10no/libF77/pow_qq.c, revision 1.1

1.1     ! root        1: #include "f2c.h"
        !             2: 
        !             3: #ifdef KR_headers
        !             4: longint pow_qq(ap, bp) longint *ap, *bp;
        !             5: #else
        !             6: longint pow_qq(longint *ap, longint *bp)
        !             7: #endif
        !             8: {
        !             9:        longint pow, x, n;
        !            10: 
        !            11:        x = *ap;
        !            12:        n = *bp;
        !            13: 
        !            14:        if (n <= 0) {
        !            15:                if (n == 0 || x == 1)
        !            16:                        return 1;
        !            17:                if (x != -1)
        !            18:                        return x == 0 ? 1/x : 0;
        !            19:                n = -n;
        !            20:                }
        !            21:        for(pow = 1; ; )
        !            22:                {
        !            23:                if(n & 01)
        !            24:                        pow *= x;
        !            25:                if(n >>= 1)
        !            26:                        x *= x;
        !            27:                else
        !            28:                        break;
        !            29:                }
        !            30:        return(pow);
        !            31:        }

unix.superglobalmegacorp.com

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