Annotation of 3BSD/cmd/lisp/subbig.c, revision 1.1.1.1

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

unix.superglobalmegacorp.com

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