- Timestamp:
- Aug 10, 2012, 2:40:20 PM (11 years ago)
- Branches:
- (u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
- Children:
- e11ed0be7258f8a5789019dc86eb3edff31cfaf5
- Parents:
- 560a3d597aa358cad2980bc2770d9ffb138c28c6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/longrat.cc
r560a3d r824c47 744 744 long aa=SR_TO_INT(a); 745 745 long bb=SR_TO_INT(b); 746 return INT_TO_SR( aa/bb);746 return INT_TO_SR((aa-(aa%bb))/bb); 747 747 } 748 748 if (SR_HDL(a) & SR_INT) … … 803 803 if (SR_HDL(a) & SR_HDL(b) & SR_INT) 804 804 { 805 if ((long)a>0L) 806 { 807 if ((long)b>0L) 808 return INT_TO_SR(SR_TO_INT(a)%SR_TO_INT(b)); 809 else 810 return INT_TO_SR(SR_TO_INT(a)%(-SR_TO_INT(b))); 811 } 812 else 813 { 814 if ((long)b>0L) 815 { 816 long i=(-SR_TO_INT(a))%SR_TO_INT(b); 817 if ( i != 0L ) i = (SR_TO_INT(b))-i; 818 return INT_TO_SR(i); 819 } 820 else 821 { 822 long i=(-SR_TO_INT(a))%(-SR_TO_INT(b)); 823 if ( i != 0L ) i = (-SR_TO_INT(b))-i; 824 return INT_TO_SR(i); 825 } 826 } 805 return INT_TO_SR(SR_TO_INT(a)%SR_TO_INT(b)); 827 806 } 828 807 if (SR_HDL(a) & SR_INT) 829 808 { 830 /* a is a small and b is a large int: -> a or (a+b) or (a-b) */ 831 if ((long)a<0L) 832 { 833 if (mpz_isNeg(b->z)) 834 return nlSub(a,b,r); 835 /*else*/ 836 return nlAdd(a,b,r); 837 } 838 /*else*/ 839 return a; 809 /* a is a small and b is a large int: -> a */ 810 return a; 840 811 } 841 812 number bb=NULL;
Note: See TracChangeset
for help on using the changeset viewer.