google / mathsteps

Step by step math solutions for everyone
https://socratic.org
Apache License 2.0
2.11k stars 276 forks source link

Cancel like terms is dependent of the order of factors in the numerator and denominator #232

Open marpol2 opened 6 years ago

marpol2 commented 6 years ago

step 1: (45 3)/(45 3) step 2: 45 / 45 step 3: (1 45) / (1 45) step 4: 1

while instead step 1: (45 3)/(3 45) step 2: (15 3) / 45 step 3: (1 3) / 3 step 4: 3 / 3 step 5: (1 3) / (1 3) step 6: 1

This can probably be fixed by just adding a check before proceeding to "cancelTerms" in "cancelLikeTerms".

evykassirer commented 6 years ago

oh- good catch! thank so much :)

I'm not prioritizing my time on writing code for mathsteps right now, but would be happy to review a change if you (or anyone else) puts one up!