Changeset a527a41 in git for libpolys/coeffs/longrat0.cc


Ignore:
Timestamp:
Jul 9, 2018, 2:39:53 PM (6 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
43fa86cc32c42433e618d6c2978915bf8a580e66
Parents:
ac754db5ea554de8a6115ff7e914fb77dc57c434
Message:
move *Eati/*EatLong to numbers.cc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/longrat0.cc

    rac754d ra527a41  
    2828
    2929/*2
    30 * extracts a long integer from s, returns the rest
    31 */
    32 const char * nlEatLong(char *s, mpz_ptr i)
    33 {
    34   const char * start=s;
    35 
    36   while (*s >= '0' && *s <= '9') s++;
    37   if (*s=='\0')
    38   {
    39     mpz_set_str(i,start,10);
    40   }
    41   else
    42   {
    43     char c=*s;
    44     *s='\0';
    45     mpz_set_str(i,start,10);
    46     *s=c;
    47   }
    48   return s;
    49 }
    50 
    51 /*2
    5230* extracts the number a from s, returns the rest
    5331*/
     
    6846    mpz_ptr n=(*a)->n;
    6947    mpz_init(z);
    70     s = nlEatLong((char *)s, z);
     48    s = nEatLong((char *)s, z);
    7149    if (*s == '/')
    7250    {
     
    7452      (*a)->s = 0;
    7553      s++;
    76       s = nlEatLong((char *)s, n);
     54      s = nEatLong((char *)s, n);
    7755      if (mpz_cmp_si(n,0L)==0)
    7856      {
Note: See TracChangeset for help on using the changeset viewer.