Package org.apache.commons.numbers.core
Interface Multiplication<T>
-
- Type Parameters:
T
- Type of elements.
- All Known Subinterfaces:
NativeOperators<T>
- All Known Implementing Classes:
BigFraction
,DD
,FP64
,Fraction
public interface Multiplication<T>
Multiplication.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
isOne()
Check if this is a neutral element of multiplication, i.e.T
multiply(T a)
Binary multiplication.T
one()
Identity element.T
reciprocal()
Multiplicative inverse.
-
-
-
Method Detail
-
one
T one()
Identity element.- Returns:
- the field element such that for all
a
,one().multiply(a).equals(a)
istrue
.
-
reciprocal
T reciprocal()
Multiplicative inverse.- Returns:
this-1
.
-
isOne
default boolean isOne()
Check if this is a neutral element of multiplication, i.e.this.multiply(a)
returnsa
or an element representing the same value asa
.The default implementation calls
equals(one())
. Implementations may want to employ more a efficient method. This may even be required if an implementation has multiple representations ofone
and itsequals
method differentiates between them.- Returns:
true
ifthis
is a neutral element of multiplication.- Since:
- 1.2
- See Also:
one()
-
-