Changeset a604c3 in git for kernel/longrat0.cc
- Timestamp:
- Apr 16, 2010, 12:15:43 PM (14 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 0f7301e691bd462913428c33f8962015a37bb532
- Parents:
- 603aebf126f77cf0b8c041b0833934960300078a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/longrat0.cc
r603aebf ra604c3 26 26 * extracts a long integer from s, returns the rest 27 27 */ 28 static const char * nlEatLong(char *s, MP_INT *i)28 static const char * nlEatLong(char *s, mpz_ptr i) 29 29 { 30 30 const char * start=s; … … 61 61 (*a)->debug=123456; 62 62 #endif 63 MP_INT *z=&((*a)->z);64 MP_INT *n=&((*a)->n);63 mpz_ptr z=(*a)->z; 64 mpz_ptr n=(*a)->n; 65 65 mpz_init(z); 66 66 s = nlEatLong((char *)s, z); … … 90 90 if ((*a)->s==3) 91 91 { 92 int ui=(int)mpz_get_si( &(*a)->z);92 int ui=(int)mpz_get_si((*a)->z); 93 93 if ((((ui<<3)>>3)==ui) 94 && (mpz_cmp_si( &(*a)->z,(long)ui)==0))94 && (mpz_cmp_si((*a)->z,(long)ui)==0)) 95 95 { 96 mpz_clear( &(*a)->z);96 mpz_clear((*a)->z); 97 97 omFreeBin((ADDRESS)(*a), rnumber_bin); 98 98 (*a)=INT_TO_SR(ui); … … 127 127 return; 128 128 } 129 int l=mpz_sizeinbase( &a->z,10);130 if (a->s<2) l=si_max(l,mpz_sizeinbase( &a->n,10));129 int l=mpz_sizeinbase(a->z,10); 130 if (a->s<2) l=si_max(l,mpz_sizeinbase(a->n,10)); 131 131 l+=2; 132 132 s=(char*)omAlloc(l); 133 z=mpz_get_str(s,10, &a->z);133 z=mpz_get_str(s,10,a->z); 134 134 StringAppendS(z); 135 135 if (a->s!=3) 136 136 { 137 137 StringAppendS("/"); 138 z=mpz_get_str(s,10, &a->n);138 z=mpz_get_str(s,10,a->n); 139 139 StringAppendS(z); 140 140 }
Note: See TracChangeset
for help on using the changeset viewer.