1: /* sccs id "@(#)ape.h 2.2 3/31/83" */ 2: 3: typedef struct mint 4: { int len; /* |len| = length in words of the MINT, 5: sgn(len) = sgn of the MINT 6: len = 0 <=> mint = 0 */ 7: short *val; /* vector is "base 2^15" rep'n of the MINT */ 8: } MINT, *PMINT; 9: #ifdef DBG 10: #include <stdio.h> 11: #define shfree(u) { fprintf(stderr, "free %o\n", u); free((char *)u);} 12: #else 13: #define shfree(u) free((char *)u) 14: #endif DBG 15: #define xfree(x) {if((x)->len!=0) {shfree((x)->val); (x)->len=0;}} 16: #define afree(x) {xfree(x);shfree(x);} 17: #define LONGCARRY 0100000L 18: #define CARRYBIT 0100000 19: #define TOPSHORT 077777 20: #define SHORT LONGCARRY 21: #define WORDLENGTH 15 /* length of the portion of the word we use */ 22: extern PMINT shtom(); 23: extern PMINT ltom(); 24: extern PMINT stom(); 25: #ifdef vax 26: #define itom(n) ltom((long)n) 27: #else 28: #define itom(n) shtom(n) 29: #endif vax 30: extern short *xalloc(); 31: extern PMINT padd(); 32: extern PMINT pmult(); 33: extern PMINT psub(); 34: extern PMINT pgcd(); 35: extern PMINT pdiv(); 36: extern PMINT pmod(); 37: extern PMINT psdiv(); 38: extern PMINT psqrt(); 39: extern PMINT remsqrt(); 40: extern PMINT ppow(); 41: extern PMINT prpow();