Skip to content

simplify(expr, rules, {}, { exactFraction: true }) not working for (only) custom rules. #2611

Answered by josdejong
JacobBeaudry asked this question in Q&A
Discussion options

You must be logged in to vote

The exactFractions option is an option of one of the built-in rules (a function rule simplifyConstant). If you clear all rules, the rule handling exactFractions is not executed. This rule currently not exposed and only used internally in simplify.

As a workaround, you can find the simplifyConstant from simplify.rules since it is (currently) the only function rule:

const simplifyConstant = math.simplify.rules.find(rule => typeof rule === 'function')

However this is not guaranteed to work in the future.

So I think we have to do the following

  1. Improve the docs of exactFractions to explain that when you clear out all rules, that this option is not executed
  2. Expose the rule somehow so you can u…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JacobBeaudry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants