commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard (Resolved) (JIRA) <>
Subject [jira] [Resolved] (MATH-686) Add methods negate() / reciprocal() to the FieldElement interface
Date Sat, 08 Oct 2011 04:55:29 GMT


Sébastien Brisard resolved MATH-686.

    Resolution: Fixed
> Add methods negate() / reciprocal() to the FieldElement interface
> -----------------------------------------------------------------
>                 Key: MATH-686
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Sébastien Brisard
>            Priority: Trivial
>             Fix For: 3.0
> As discussed on the mailing list, it is proposed to add two methods to the {{FieldElement}}
> * {{negate()}} : returns the additive inverse of {{this}} element.
> * {{reciprocal()}} : returns the multiplicative inverse of {{this}} element.
> Several name couples have been proposed by Phil
> # {{negate}}, {{invert}}
> # {{opposite}}, {{reciprocal}}
> # {{additiveInverse}}, {{multiplicativeInverse}}
> Looking at the classes implementing this interface in the core CM library, we find that
> * {{Complex}}, {{Dfp}}, {{BigFraction}} and {{Fraction}} already have a {{negate()}}
> * Besides, {{BigFraction}} and {{Fraction}} already have a {{reciprocal()}} method.
> So the best naming option would seem to be (for the time being) a mixture of what Phil
proposed. I realize it's not completely satisfactory because one is a noun and one a verb.
Do we want to have good grammar, or preserve what's already implemented? I tend to favour
the first option (consistently change the name of existing methods).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message