diff options
Diffstat (limited to 'src/main/java/sevenUnits/unit/UnitPrefix.java')
-rw-r--r-- | src/main/java/sevenUnits/unit/UnitPrefix.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/sevenUnits/unit/UnitPrefix.java b/src/main/java/sevenUnits/unit/UnitPrefix.java index e1f7788..824f60b 100644 --- a/src/main/java/sevenUnits/unit/UnitPrefix.java +++ b/src/main/java/sevenUnits/unit/UnitPrefix.java @@ -158,6 +158,22 @@ public final class UnitPrefix implements Nameable { } /** + * Adds {@code other} to this prefix and returns the result. + * @since 2024-03-03 + */ + public UnitPrefix plus(final UnitPrefix other) { + return valueOf(this.getMultiplier() + other.getMultiplier()); + } + + /** + * Subtracts {@code other} from this prefix and returns the result. + * @since 2024-03-03 + */ + public UnitPrefix minus(final UnitPrefix other) { + return valueOf(this.getMultiplier() - other.getMultiplier()); + } + + /** * Multiplies this prefix by {@code other}. * * @param other prefix to multiply by |