[
https://issues.apache.org/jira/browse/NUMBERS-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alex Herbert resolved NUMBERS-192.
----------------------------------
Fix Version/s: 1.2
Resolution: Implemented
Add in commit:
496740c6be6925c173c8860982ec9de238c40f2f
> Add subtract method to Sum
> --------------------------
>
> Key: NUMBERS-192
> URL: https://issues.apache.org/jira/browse/NUMBERS-192
> Project: Commons Numbers
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.1
> Reporter: Alex Herbert
> Priority: Trivial
> Fix For: 1.2
>
>
> The Sum class can be used to add and subtract many terms. Subtraction of
> individual terms is performed by negating the argument and using the {{add}}
> method:
> {code:java}
> Sum.of(1, -2, 3, -4, 5).add(-6).add(7)
> {code}
> However there is no subtract method for subtraction of another sum to
> complement the {{add(Sum)}} method. This prevents using the extended
> precision part of the Sum in subtraction.
> I suggest adding:
> {code:java}
> public Sum subtract(Sum other){code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)