Package org.apfloat.jscience
Class ApfloatField
- All Implemented Interfaces:
Serializable
,Comparable<ApfloatField>
,Immutable
,Realtime
,ValueType
,XMLSerializable
,Field<ApfloatField>
,GroupAdditive<ApfloatField>
,GroupMultiplicative<ApfloatField>
,Ring<ApfloatField>
,Structure<ApfloatField>
This class represents an arbitrary precision floating-point number.
The precision of each calculation is determined separately, which means
that loss of precision can easily accumulate in complicated calculations
(e.g. matrix inversion). If this should be avoided, and a fixed precision is
required, then it may be better to use FixedPrecisionApfloatField
instead.
- Since:
- 1.8.0
- Version:
- 1.8.0
- Author:
- Mikko Tommila
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionApfloatField
(Apfloat value) Constructs a new floating-point field object with the specified value. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns a copy of this object.inverse()
Returns the multiplicative inverse of this object.opposite()
Returns the additive inverse of this object.plus
(ApfloatField that) Returns the sum of this object with the one specified.times
(ApfloatField that) Returns the product of this object with the one specified.Methods inherited from class org.apfloat.jscience.AbstractField
compareTo, doubleValue, equals, hashCode, isLargerThan, longValue, toText, value
Methods inherited from class org.jscience.mathematics.number.Number
byteValue, floatValue, intValue, isGreaterThan, isLessThan, minus, pow, shortValue, toString
-
Constructor Details
-
ApfloatField
Constructs a new floating-point field object with the specified value.- Parameters:
value
- The value.
-
-
Method Details
-
plus
Description copied from class:AbstractField
Returns the sum of this object with the one specified.- Specified by:
plus
in interfaceGroupAdditive<ApfloatField>
- Specified by:
plus
in classAbstractField<ApfloatField,
Apfloat> - Parameters:
that
- The addend.- Returns:
this + that
-
opposite
Description copied from class:AbstractField
Returns the additive inverse of this object.- Specified by:
opposite
in interfaceGroupAdditive<ApfloatField>
- Specified by:
opposite
in classAbstractField<ApfloatField,
Apfloat> - Returns:
-this
-
times
Description copied from class:AbstractField
Returns the product of this object with the one specified.- Specified by:
times
in interfaceGroupMultiplicative<ApfloatField>
- Specified by:
times
in interfaceRing<ApfloatField>
- Specified by:
times
in classAbstractField<ApfloatField,
Apfloat> - Parameters:
that
- The multiplicand.- Returns:
this * that
-
inverse
Description copied from class:AbstractField
Returns the multiplicative inverse of this object.- Specified by:
inverse
in interfaceGroupMultiplicative<ApfloatField>
- Specified by:
inverse
in classAbstractField<ApfloatField,
Apfloat> - Returns:
1 / this
- Throws:
ArithmeticException
- If the divisor is zero.
-
copy
Description copied from class:AbstractField
Returns a copy of this object.- Specified by:
copy
in interfaceValueType
- Specified by:
copy
in classAbstractField<ApfloatField,
Apfloat> - Returns:
- A copy of this object.
-