Method names refer to the action performed:
For instances a,b
of class {@link mfc.number.Complex},
a.plus(b)
produces a new instance of containing the sum
a+b
.
Assign
-methods do NOT create new instances:
For instances a,b
of class Complex,
a.assignPlus(a,b)
stores the sum a+b
in a
. a.assignPlus(b)
stores the sum
a+b
in a
, like the operator
"+="
does for simple types.
All non-commutatitve operations (for instances of
{@link mfc.number.Quaternion}) are RIGHT OPERATIONS !
For instances a,b
of class {@link mfc.number.Quaternion},
a.assignTimes(b)
stores the product a*b
in a
. To store b*a
in a
,
you would have to call a.assignTimes(b,a)
.
Instances interact with doubles
For an instance a
and a double r
,
a.times(r)
creates a new instance containing the
product a*r