Package org.apfloat.jscience
Class ApfloatField
- java.lang.Object
-
- java.lang.Number
-
- org.jscience.mathematics.number.Number<T>
-
- org.apfloat.jscience.AbstractField<ApfloatField,org.apfloat.Apfloat>
-
- org.apfloat.jscience.ApfloatField
-
- All Implemented Interfaces:
Serializable,Comparable<ApfloatField>,javolution.lang.Immutable,javolution.lang.Realtime,javolution.lang.ValueType,javolution.xml.XMLSerializable,org.jscience.mathematics.structure.Field<ApfloatField>,org.jscience.mathematics.structure.GroupAdditive<ApfloatField>,org.jscience.mathematics.structure.GroupMultiplicative<ApfloatField>,org.jscience.mathematics.structure.Ring<ApfloatField>,org.jscience.mathematics.structure.Structure<ApfloatField>
public class ApfloatField extends AbstractField<ApfloatField,org.apfloat.Apfloat>
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
FixedPrecisionApfloatFieldinstead.- Since:
- 1.8.0
- Version:
- 1.8.0
- Author:
- Mikko Tommila
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApfloatField(org.apfloat.Apfloat value)Constructs a new floating-point field object with the specified value.
-
Method Summary
Modifier and Type Method Description ApfloatFieldcopy()Returns a copy of this object.ApfloatFieldinverse()Returns the multiplicative inverse of this object.ApfloatFieldopposite()Returns the additive inverse of this object.ApfloatFieldplus(ApfloatField that)Returns the sum of this object with the one specified.ApfloatFieldtimes(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
-
-
-
-
Method Detail
-
plus
public ApfloatField plus(ApfloatField that)
Description copied from class:AbstractFieldReturns the sum of this object with the one specified.- Specified by:
plusin interfaceorg.jscience.mathematics.structure.GroupAdditive<ApfloatField>- Specified by:
plusin classAbstractField<ApfloatField,org.apfloat.Apfloat>- Parameters:
that- The addend.- Returns:
this + that
-
opposite
public ApfloatField opposite()
Description copied from class:AbstractFieldReturns the additive inverse of this object.- Specified by:
oppositein interfaceorg.jscience.mathematics.structure.GroupAdditive<ApfloatField>- Specified by:
oppositein classAbstractField<ApfloatField,org.apfloat.Apfloat>- Returns:
-this
-
times
public ApfloatField times(ApfloatField that)
Description copied from class:AbstractFieldReturns the product of this object with the one specified.- Specified by:
timesin interfaceorg.jscience.mathematics.structure.GroupMultiplicative<ApfloatField>- Specified by:
timesin interfaceorg.jscience.mathematics.structure.Ring<ApfloatField>- Specified by:
timesin classAbstractField<ApfloatField,org.apfloat.Apfloat>- Parameters:
that- The multiplicand.- Returns:
this * that
-
inverse
public ApfloatField inverse() throws ArithmeticException
Description copied from class:AbstractFieldReturns the multiplicative inverse of this object.- Specified by:
inversein interfaceorg.jscience.mathematics.structure.GroupMultiplicative<ApfloatField>- Specified by:
inversein classAbstractField<ApfloatField,org.apfloat.Apfloat>- Returns:
1 / this- Throws:
ArithmeticException- If the divisor is zero.
-
copy
public ApfloatField copy()
Description copied from class:AbstractFieldReturns a copy of this object.- Specified by:
copyin interfacejavolution.lang.ValueType- Specified by:
copyin classAbstractField<ApfloatField,org.apfloat.Apfloat>- Returns:
- A copy of this object.
-
-