Changeset 125f52 in git
- Timestamp:
- Jun 22, 2021, 2:38:53 PM (3 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- 2f2b5f27210262b4fd98f73ae2256916f77e8eff
- Parents:
- 5a6c9c9f73563e1e976f2d14b37862e4c77cd9e3
- Location:
- libpolys/coeffs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/longrat.cc
r5a6c9c r125f52 423 423 } 424 424 425 static number nlMapR_BI(number from, const coeffs src, const coeffs dst) 426 { 427 assume( getCoeffType(src) == n_R ); 428 429 double f=nrFloat(from); // FIXME? TODO? // extern float nrFloat(number n); 430 if (f==0.0) return INT_TO_SR(0); 431 long l=long(f); 432 return nlInit(l,dst); 433 } 434 425 435 static number nlMapLongR(number from, const coeffs src, const coeffs dst) 426 436 { … … 503 513 } 504 514 515 static number nlMapLongR_BI(number from, const coeffs src, const coeffs dst) 516 { 517 assume( getCoeffType(src) == n_long_R ); 518 519 gmp_float *ff=(gmp_float*)from; 520 if (mpf_fits_slong_p(ff->t)) 521 { 522 long l=mpf_get_si(ff->t); 523 return nlInit(l,dst); 524 } 525 return nlInit(0,dst); 526 } 505 527 506 528 static number nlMapC(number from, const coeffs src, const coeffs dst) … … 2459 2481 if ((src->rep==n_rep_float) && nCoeff_is_R(src)) 2460 2482 { 2461 return nlMapR; 2483 if (dst->is_field) /* R -> Q */ 2484 return nlMapR; 2485 else 2486 return nlMapR_BI; /* R -> bigint */ 2462 2487 } 2463 2488 if ((src->rep==n_rep_gmp_float) && nCoeff_is_long_R(src)) 2464 2489 { 2465 return nlMapLongR; /* long R -> Q */ 2490 if (dst->is_field) 2491 return nlMapLongR; /* long R -> Q */ 2492 else 2493 return nlMapLongR_BI; 2466 2494 } 2467 2495 if (nCoeff_is_long_C(src)) -
libpolys/coeffs/mpr_complex.h
r5a6c9c r125f52 148 148 #endif 149 149 150 p rivate:150 public: 151 151 mpf_t t; 152 152 };
Note: See TracChangeset
for help on using the changeset viewer.