Hi.

Le ven. 6 déc. 2019 à 16:47, Alex Herbert <alex.d.herb...@gmail.com> a écrit :
>
> I think this method is redundant:
>
> public Complex multiply(final int factor) {
>      return new Complex(real * factor, imaginary * factor);
> }
>
> given that there is:
>
> public Complex multiply(double factor) {
>      return new Complex(real * factor, imaginary * factor);
> }
>
> This would be equivalent after the implicit conversion of the int to a
> double for the multiplication. Am I missing something here?

I don't think so (or I'm missing it too).

>
> There is no equivalent for divide(double) (i.e. divide(int)).
>
> I propose to remove this method.

+1

>
>
> I would like to reorder the internals of Complex to be like the order of
> the C99 reference.

+1

Gilles

> At the moment the methods are a bit jumbled.
>
> I think something like this:
>
> Constructors
>
> Properties (real(), imaginary())
>
> Properties which are methods (abs(), arg())
>
> Standard object stuff:
> toString(), parse(), equals(), hashCode()
> (Perhaps parse should be with the factory constructor methods?)
>
> C99 order for Complex math:
>
> Arithmetic (add, subtract, multiply, divide)
>
> Trigonometric functions
>
> Hyperbolic functions
>
> Exponential and logarithmic functions
>
> Power and absolute-value function
>
> Other functions...
>
>
> Alex
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to