bridge/class-master/depend/pari/src/modules/mpqs.c
/* compares two `large prime' relations according to their first element
 * (the large prime itself). */
compares two `large prime' relations according to their first element
(the large prime itself).
compares two ` large prime ' relations according to their first element ( the large prime itself ) .
static int
mpqs_relations_cmp(const void *a, const void *b)
{
  char **sa = (char**) a;
  char **sb = (char**) b;
  long qa = strtol(*sa, NULL, 10);
  long qb = strtol(*sb, NULL, 10);
  if (qa < qb) return -1;
  else if (qa > qb) return 1;
  else return strcmp(*sa, *sb);
}
static int mpqs_relations_cmp ( const void * a , const void * b ) { char * * sa = ( char * * ) a ; char * * sb = ( char * * ) b ; long qa = strtol ( * sa , NULL , 10 ) ; long qb = strtol ( * sb , NULL , 10 ) ; if ( qa < qb ) return -1 ; else if ( qa > qb ) return 1 ; else return strcmp ( * sa , * sb ) ; }
compares two `large prime' relations according to their first element
 (the large prime itself).
compares two ` large prime ' relations according to their first element ( the large prime itself ) .
/* atol() isn't entirely portable for the Full Relations case where the
     strings of digits are too long to fit into a long --GN */