#1575: Fixed the implementation of equivalent for ratios#1576
#1575: Fixed the implementation of equivalent for ratios#1576
equivalent for ratios#1576Conversation
|
Formatting check succeeded! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1576 +/- ##
=========================================
Coverage 64.92% 64.92%
+ Complexity 1981 1976 -5
=========================================
Files 499 499
Lines 28814 28820 +6
Branches 5667 5667
=========================================
+ Hits 18707 18711 +4
- Misses 7795 7797 +2
Partials 2312 2312 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
equivalent for ratios~ for ratios
~ for ratiosequivalent for ratios
|
Sorry I didn't communicate this in the bug report (only here) but I have a branch that fixes |
|
I submitted my branch as a pull request for reference. |
…`equivalent` for ratio
|
Hi @scymtym I'd tackle this separately from the broader "unit-aware quantity operations" feature, so this PR is good to go first while yours is in review. I can jump on to reviewing your PR next (which is very impressive!). I did like your |
|


Closes #1575:
equivalentlogic for ratios to make e.g.1'cm':2'cm' ~ 2'cm':4'cm'evaluate totrue. The result is calculated asequivalent(a.numerator * b.denominator, b.numerator * a.denominator).divideevaluator to make dividing by a 0-valued quantity returnnull. Previously it threw a NullPointerException.