Annotation of 41BSD/cmd/lisp/subbig.c, revision 1.1

1.1     ! root        1: static char *sccsid = "@(#)subbig.c    34.1 10/3/80";
        !             2: 
        !             3: #include "global.h"
        !             4: 
        !             5: lispval
        !             6: subbig(pos,neg)
        !             7: lispval pos, neg;
        !             8: {
        !             9:        register lispval work;
        !            10:        int *sp(); lispval adbig();
        !            11:        register int *mysp = sp() - 2;
        !            12:        register int *ersatz = mysp;
        !            13:        snpand(3);
        !            14: 
        !            15:        for(work = neg; work!=0; work = work->s.CDR) {
        !            16:                stack(-work->i, (mysp -= 2));
        !            17:        }
        !            18:        mysp[3] = 0;
        !            19:        return(adbig(pos,ersatz));
        !            20: }
        !            21: /*
        !            22:  * subbig -- subtract one bignum from another.
        !            23:  *
        !            24:  * What this does is it negates each coefficient of a copy of the bignum
        !            25:  * which is just pushed on the stack for convenience.  This may give rise
        !            26:  * to a bignum which is not in canonical form, but is nonetheless a repre
        !            27:  * sentation of a bignum.  Addbig then adds it to a bignum, and produces
        !            28:  * a result in canonical form.
        !            29:  */

unix.superglobalmegacorp.com

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