-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
math.Fraction.REDUCE doesn't work from mathjs 10.0.1 #50
Comments
Added comment : It seems that you have remove in 4.2.0 the Fraction['REDUCE'] tests. Therefore, my workaround is to come back to mathjs 10.0.0 and install manually fraction.js version 4.1.1 |
Yes, I removed this as it introduced overflow problems quickly and I did not like the implementation. It was added due to a bug report back then, but after running an operation on a fraction (like adding, multiplying, ...), the result can be something not expected, due to the way the operations are implemented internally. And from my perspective, and probably the standard definition, a fraction only is the ratio of numerator and denominator and thus makes much more sense to keep it in a reduced form. I searched for it in mathjs to not introduce a bug, but didn't know that people try to use it outside, like you did. |
Hello, actually I've figured out the use of the flag math.Fraction.REDUCE in an old message in this repo. Regarding my need, it's still a core feature that I implemented in the core of my project two years ago. I've been using it for educational purposes to offer learners the opportunity to work with non-reduced fractions as well as reduced fractions. For instance, I can generate non-reduced Fractions and ask learners to find their irreducible forms. Concretely I set Fraction.REDUCE globally to false to control manually the reduction of fractions. Depending on my needs, I can reduce them with the gcd operator or not. Without ability to disable automatic reduction, I cannot anymore manipulate unreduced fractions and I'm coerced to only use reduced fractions. Thus, It is a real issue for pedagogical purpose. Hope we could find a workaround... |
Hi,
First of all, thanks for the fantastic work on fractions.
I think I've figured out a bug with the flag math.Fraction.REDUCE allowing to reduce or not fractions automaticly.
With mathjs 10.0.0 the code :
From mathjs 10.0.1 the code :
Thus, it seems that from mathjs 10.0.1 the REDUCE flag has no more effect.
Thanks for your help.
Chris
The text was updated successfully, but these errors were encountered: