r-quantities / units

Measurement units for R
https://r-quantities.github.io/units
172 stars 27 forks source link

Always allow division of identical units #335

Closed billdenney closed 1 year ago

billdenney commented 1 year ago

Fix #310

This always allows division of units, if they are equal, and it returns a unitless object.

codecov[bot] commented 1 year ago

Codecov Report

Base: 91.54% // Head: 91.78% // Increases project coverage by +0.24% :tada:

Coverage data is based on head (130b566) compared to base (3884458). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #335 +/- ## ========================================== + Coverage 91.54% 91.78% +0.24% ========================================== Files 19 19 Lines 934 950 +16 ========================================== + Hits 855 872 +17 + Misses 79 78 -1 ``` | [Impacted Files](https://codecov.io/gh/r-quantities/units/pull/335?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=r-quantities) | Coverage Δ | | |---|---|---| | [R/arith.R](https://codecov.io/gh/r-quantities/units/pull/335/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=r-quantities#diff-Ui9hcml0aC5S) | `96.77% <100.00%> (+0.67%)` | :arrow_up: | | [R/make\_units.R](https://codecov.io/gh/r-quantities/units/pull/335/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=r-quantities#diff-Ui9tYWtlX3VuaXRzLlI=) | `90.67% <0.00%> (+0.84%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=r-quantities). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=r-quantities)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

billdenney commented 1 year ago

The product when the units are inverted should work, too. Let me think about that a bit...

billdenney commented 1 year ago

I just added a commit so that inverse unit multiplication always works.