Blob
1 #include "os.h"2 #include <mp.h>3 #include "dat.h"5 // return neg, 0, pos as abs(b1)-abs(b2) is neg, 0, pos6 int7 mpmagcmp(mpint *b1, mpint *b2)8 {9 int i;11 i = b1->top - b2->top;12 if(i)13 return i;15 return mpveccmp(b1->p, b1->top, b2->p, b2->top);16 }18 // return neg, 0, pos as b1-b2 is neg, 0, pos19 int20 mpcmp(mpint *b1, mpint *b2)21 {22 if(b1->sign != b2->sign)23 return b1->sign - b2->sign;24 if(b1->sign < 0)25 return mpmagcmp(b2, b1);26 else27 return mpmagcmp(b1, b2);28 }