Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

multiply fractions edge case to support cancelling #139

Closed
evykassirer opened this issue Feb 22, 2017 · 4 comments
Closed

multiply fractions edge case to support cancelling #139

evykassirer opened this issue Feb 22, 2017 · 4 comments

Comments

@evykassirer
Copy link
Contributor

evykassirer commented Feb 22, 2017

there are some cases where we don't want to multiply fractions with other things, one of them is 9/2 * x -> 9x / 2 (since this doesn't change anything and could be considered less readable)

a case we're not handling with the current logic, that should multiply is:

x * 6/x -> (x * 6) / x (which is needed for cancelling out)

one solution is just to have better cancelling code that doesn't only work with the fraction 6x/x, and can recognize that x cancels with the denominator in 6/x

another (possibly easier for now) solution would be to add a case for multiplying a symbol times a term with a symbol in the denominator

... this is a bit messy, so I'm not sure what the best solution is - open to suggestions!

this came up because of a case in #88

@kevinbarabash
Copy link
Contributor

my vote would be for better canceling code.

@aelnaiem
Copy link
Contributor

I agree with @kevinbarabash, let's improve the canceling code so it handles this case

@evykassirer
Copy link
Contributor Author

I'd love for that to happen :) just haven't had the time to figure out the best way for that to work

@ldworkin
Copy link
Contributor

Fixed by 344d15b

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants