Skip to content

Commit

Permalink
Fixes #258
Browse files Browse the repository at this point in the history
- Make sure not to include the coefficient when
  checking for symbols, vectors, etc. in the gcd
  routine.
  • Loading branch information
benruijl committed Jan 24, 2018
1 parent 92325ea commit 8b945c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sources/ratio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2087,7 +2087,7 @@ int GCDterms(PHEAD WORD *term1, WORD *term2, WORD *termout)
t2 = term2+1;
if ( *t1 == SYMBOL ) {
while ( t2 < t2stop && *t2 != SYMBOL ) t2 += t2[1];
if ( *t2 == SYMBOL ) {
if ( t2 < t2stop && *t2 == SYMBOL ) {
t2next = t2+t2[1];
tt1 = t1+2; tt2 = t2+2; count1 = 0;
while ( tt1 < t1next && tt2 < t2next ) {
Expand All @@ -2114,7 +2114,7 @@ int GCDterms(PHEAD WORD *term1, WORD *term2, WORD *termout)
}
else if ( *t1 == DOTPRODUCT ) {
while ( t2 < t2stop && *t2 != DOTPRODUCT ) t2 += t2[1];
if ( *t2 == DOTPRODUCT ) {
if ( t2 < t2stop && *t2 == DOTPRODUCT ) {
t2next = t2+t2[1];
tt1 = t1+2; tt2 = t2+2; count1 = 0;
while ( tt1 < t1next && tt2 < t2next ) {
Expand Down Expand Up @@ -2142,7 +2142,7 @@ int GCDterms(PHEAD WORD *term1, WORD *term2, WORD *termout)
}
else if ( *t1 == VECTOR ) {
while ( t2 < t2stop && *t2 != VECTOR ) t2 += t2[1];
if ( *t2 == VECTOR ) {
if ( t2 < t2stop && *t2 == VECTOR ) {
t2next = t2+t2[1];
tt1 = t1+2; tt2 = t2+2; count1 = 0;
while ( tt1 < t1next && tt2 < t2next ) {
Expand All @@ -2162,7 +2162,7 @@ int GCDterms(PHEAD WORD *term1, WORD *term2, WORD *termout)
}
else if ( *t1 == INDEX ) {
while ( t2 < t2stop && *t2 != INDEX ) t2 += t2[1];
if ( *t2 == INDEX ) {
if ( t2 < t2stop && *t2 == INDEX ) {
t2next = t2+t2[1];
tt1 = t1+2; tt2 = t2+2; count1 = 0;
while ( tt1 < t1next && tt2 < t2next ) {
Expand All @@ -2181,7 +2181,7 @@ int GCDterms(PHEAD WORD *term1, WORD *term2, WORD *termout)
}
else if ( *t1 == DELTA ) {
while ( t2 < t2stop && *t2 != DELTA ) t2 += t2[1];
if ( *t2 == DELTA ) {
if ( t2 < t2stop && *t2 == DELTA ) {
t2next = t2+t2[1];
tt1 = t1+2; tt2 = t2+2; count1 = 0;
while ( tt1 < t1next && tt2 < t2next ) {
Expand Down

0 comments on commit 8b945c1

Please sign in to comment.