[
https://issues.apache.org/jira/browse/MATH-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15182238#comment-15182238
]
Gilles commented on MATH-1332:
------------------------------
bq. it's not really an accessor method since the argument is computed
Strictly speaking, whether it is computed or just read is irrelevant to the
choice, as it is an "implementation detail": we currently store the real and
imaginary parts but we could conceivably change that in the future without
impact on the API.
More important is that the naming scheme is consistent within the class (and,
hopefully, across the library); hence IMO if you change "getArgument" to "arg",
you should also change "getReal" to "real" (or "re", if shorter is better) and
similarly for "getImaginary".
TBD on the "dev" ML.
> For 4.0, deprecate method name getArgument() and replace with arg()
> -------------------------------------------------------------------
>
> Key: MATH-1332
> URL: https://issues.apache.org/jira/browse/MATH-1332
> Project: Commons Math
> Issue Type: Improvement
> Affects Versions: 4.0
> Reporter: Eric Barnhill
> Priority: Trivial
> Original Estimate: 0.5h
> Remaining Estimate: 0.5h
>
> Currently magnitude of complex is returned by calling abs while phase angle
> is returned by calling getArgument(). I propose deprecating getArgument and
> using arg() because:
> -- it's not really an accessor method since the argument is computed
> -- arg() is shorter, more elegant and similar to abs() with which its usage
> will sometimes be paired
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)