Annotation of researchv9/jerq/src/lib/j/sqrt.c, revision 1.1

1.1     ! root        1: #define MAXROOT 0xb504
        !             2: sqrt(x)
        !             3:        register long x;
        !             4: {
        !             5:        register long high=MAXROOT;
        !             6:        register long low=0;
        !             7:        register long current=MAXROOT/2;
        !             8:        if(x<=0)
        !             9:                return 0;
        !            10:        if(x>=MAXROOT*MAXROOT)
        !            11:                return(MAXROOT);
        !            12:        while(high>low+1){
        !            13:                if(current*current==x)
        !            14:                        return (current);
        !            15:                if(current*current>x)
        !            16:                        high=current;
        !            17:                else
        !            18:                        low=current;
        !            19:                current=(high+low)>>1;
        !            20:        }
        !            21:        return(current);
        !            22: }

unix.superglobalmegacorp.com

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