Skip to content
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

feat(rules): add MultiplicativeInverse rule #19

Merged
merged 10 commits into from
Feb 6, 2024

Conversation

justindujardin
Copy link
Member

People keep asking why mathy can't handle "4x / (2x + 7)" and friends. Division isn't supported for our workhorse rules like Distributive Property, Commutative Property, etc.

Luckily we can use the multiplicative inverse rule to transform division into a multiplication of the reciprocal of the denominator.

This is most easily explained with an example 4 / 2 = 4 * 1 / 2.

After conversion, expressions can be further simplified with other rules.

 - for handling / in expressions
Copy link

netlify bot commented Feb 5, 2024

Deploy Preview for friendly-daifuku-ae17d2 ready!

Name Link
🔨 Latest commit 3743b4f
🔍 Latest deploy log https://app.netlify.com/sites/friendly-daifuku-ae17d2/deploys/65c17bb48fc2c40007810ff6
😎 Deploy Preview https://deploy-preview-19--friendly-daifuku-ae17d2.netlify.app/api/rules/variable_multiply
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ce56d37) 88.69% compared to head (3743b4f) 89.49%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
+ Coverage   88.69%   89.49%   +0.80%     
==========================================
  Files          21       22       +1     
  Lines        2520     2560      +40     
==========================================
+ Hits         2235     2291      +56     
+ Misses        285      269      -16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@justindujardin justindujardin marked this pull request as ready for review February 5, 2024 23:36
@justindujardin justindujardin merged commit 40a2d88 into master Feb 6, 2024
12 checks passed
@justindujardin justindujardin deleted the feat/multiplicative_inverse branch February 6, 2024 00:43
@justindujardin justindujardin added the rules PRs related to implementing rules label Feb 6, 2024
github-actions bot pushed a commit that referenced this pull request Feb 6, 2024
## [0.9.4](v0.9.3...v0.9.4) (2024-02-06)

### Features

* **rules:** add MultiplicativeInverse rule ([#19](#19)) ([40a2d88](40a2d88))
Copy link

github-actions bot commented Feb 6, 2024

🎉 This PR is included in version 0.9.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released rules PRs related to implementing rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant