Changeset 863333 in git
- Timestamp:
- Jan 15, 2015, 11:45:47 AM (8 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 777f8bb0bd3e850c5c7084702f167df3c1b53113
- Parents:
- cee2052c592af6805a2f85edda3e0bd517fb1b69
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/longrat.cc
rcee2052 r863333 81 81 #endif 82 82 83 extern number nlOne; // FIXME? TODO? // move into coeffs?84 85 83 nMapFunc nlSetMap(const coeffs src, const coeffs dst); 86 84 … … 97 95 98 96 // 64 bit version: 99 //#if SIZEOF_LONG == 8100 #if 097 #if SIZEOF_LONG == 8 98 //#if 0 101 99 #define MAX_NUM_SIZE 60 102 100 #define POW_2_28 (1L<<60) … … 178 176 179 177 180 number nlOne=INT_TO_SR(1);181 182 178 #if (__GNU_MP_VERSION*10+__GNU_MP_VERSION_MINOR < 31) 183 179 void mpz_mul_si (mpz_ptr r, mpz_srcptr s, long int si) … … 331 327 //} 332 328 if (mpz_size1(a->z)>MP_SMALL) return TRUE; 333 LONG ui=( int)mpz_get_si(a->z);329 LONG ui=(LONG)mpz_get_si(a->z); 334 330 if ((((ui<<3)>>3)==ui) 335 331 && (mpz_cmp_si(a->z,(long)ui)==0)) 336 332 { 337 333 Print("!!longrat:im int %d in %s:%d\n",ui,f,l); 338 f=NULL;339 334 return FALSE; 340 335 } … … 392 387 if (f.isImm()) 393 388 { 394 const long lz=f.intval(); 395 const int iz=(int)lz; 396 if ((long)iz==lz) 397 return nlInit(f.intval(),r); 398 else 399 return nlRInit(lz); 400 // return nlInit(f.intval(),r); 389 return nlInit(f.intval(),r); 401 390 } 402 391 else … … 2367 2356 { 2368 2357 number n; 2358 #if MAX_NUM_SIZE == 60 2359 if (((i << 3) >> 3) == i) n=INT_TO_SR(i); 2360 else n=nlRInit(i); 2361 #else 2369 2362 LONG ii=(LONG)i; 2370 if ( ((ii << 3) >> 3) == ii ) n=INT_TO_SR(ii); 2371 else n=nlRInit(ii); 2363 if ( (((long)ii==i) && ((ii << 3) >> 3) == ii )) n=INT_TO_SR(ii); 2364 else n=nlRInit(i); 2365 #endif 2372 2366 nlTest(n, r); 2373 2367 return n;
Note: See TracChangeset
for help on using the changeset viewer.