URI:
       tmpveccmp.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tmpveccmp.c (378B)
       ---
            1 #include "os.h"
            2 #include <mp.h>
            3 #include "dat.h"
            4 
            5 int
            6 mpveccmp(mpdigit *a, int alen, mpdigit *b, int blen)
            7 {
            8         mpdigit x;
            9 
           10         while(alen > blen)
           11                 if(a[--alen] != 0)
           12                         return 1;
           13         while(blen > alen)
           14                 if(b[--blen] != 0)
           15                         return -1;
           16         while(alen > 0){
           17                 --alen;
           18                 x = a[alen] - b[alen];
           19                 if(x == 0)
           20                         continue;
           21                 if(x > a[alen])
           22                         return -1;
           23                 else
           24                         return 1;
           25         }
           26         return 0;
           27 }