Package org.apfloat.jscience
Class FixedPrecisionApfloatField
- java.lang.Object
-
- java.lang.Number
-
- org.jscience.mathematics.number.Number<T>
-
- org.apfloat.jscience.AbstractField<FixedPrecisionApfloatField,org.apfloat.Apfloat>
-
- org.apfloat.jscience.FixedPrecisionApfloatField
-
- All Implemented Interfaces:
Serializable,Comparable<FixedPrecisionApfloatField>,javolution.lang.Immutable,javolution.lang.Realtime,javolution.lang.ValueType,javolution.xml.XMLSerializable,org.jscience.mathematics.structure.Field<FixedPrecisionApfloatField>,org.jscience.mathematics.structure.GroupAdditive<FixedPrecisionApfloatField>,org.jscience.mathematics.structure.GroupMultiplicative<FixedPrecisionApfloatField>,org.jscience.mathematics.structure.Ring<FixedPrecisionApfloatField>,org.jscience.mathematics.structure.Structure<FixedPrecisionApfloatField>
public class FixedPrecisionApfloatField extends AbstractField<FixedPrecisionApfloatField,org.apfloat.Apfloat>
This class represents a fixed-precision floating-point number. The precision is reset after each computation using the providedFixedPrecisionApfloatHelper. This can help avoid accumulating round-off errors and loss of precision in complicated computations such as matrix inversion.- Since:
- 1.8.0
- Version:
- 1.8.0
- Author:
- Mikko Tommila
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FixedPrecisionApfloatField(org.apfloat.Apfloat value, org.apfloat.FixedPrecisionApfloatHelper helper)Constructs a new floating-point field object with the specified value.
-
Method Summary
Modifier and Type Method Description FixedPrecisionApfloatFieldcopy()Returns a copy of this object.org.apfloat.FixedPrecisionApfloatHelperhelper()Return the precision helper.FixedPrecisionApfloatFieldinverse()Returns the multiplicative inverse of this object.FixedPrecisionApfloatFieldopposite()Returns the additive inverse of this object.FixedPrecisionApfloatFieldplus(FixedPrecisionApfloatField that)Returns the sum of this object with the one specified.FixedPrecisionApfloatFieldtimes(FixedPrecisionApfloatField 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 FixedPrecisionApfloatField plus(FixedPrecisionApfloatField that)
Description copied from class:AbstractFieldReturns the sum of this object with the one specified.- Specified by:
plusin interfaceorg.jscience.mathematics.structure.GroupAdditive<FixedPrecisionApfloatField>- Specified by:
plusin classAbstractField<FixedPrecisionApfloatField,org.apfloat.Apfloat>- Parameters:
that- The addend.- Returns:
this + that
-
opposite
public FixedPrecisionApfloatField opposite()
Description copied from class:AbstractFieldReturns the additive inverse of this object.- Specified by:
oppositein interfaceorg.jscience.mathematics.structure.GroupAdditive<FixedPrecisionApfloatField>- Specified by:
oppositein classAbstractField<FixedPrecisionApfloatField,org.apfloat.Apfloat>- Returns:
-this
-
times
public FixedPrecisionApfloatField times(FixedPrecisionApfloatField that)
Description copied from class:AbstractFieldReturns the product of this object with the one specified.- Specified by:
timesin interfaceorg.jscience.mathematics.structure.GroupMultiplicative<FixedPrecisionApfloatField>- Specified by:
timesin interfaceorg.jscience.mathematics.structure.Ring<FixedPrecisionApfloatField>- Specified by:
timesin classAbstractField<FixedPrecisionApfloatField,org.apfloat.Apfloat>- Parameters:
that- The multiplicand.- Returns:
this * that
-
inverse
public FixedPrecisionApfloatField inverse() throws ArithmeticException
Description copied from class:AbstractFieldReturns the multiplicative inverse of this object.- Specified by:
inversein interfaceorg.jscience.mathematics.structure.GroupMultiplicative<FixedPrecisionApfloatField>- Specified by:
inversein classAbstractField<FixedPrecisionApfloatField,org.apfloat.Apfloat>- Returns:
1 / this- Throws:
ArithmeticException- If the divisor is zero.
-
copy
public FixedPrecisionApfloatField copy()
Description copied from class:AbstractFieldReturns a copy of this object.- Specified by:
copyin interfacejavolution.lang.ValueType- Specified by:
copyin classAbstractField<FixedPrecisionApfloatField,org.apfloat.Apfloat>- Returns:
- A copy of this object.
-
helper
public org.apfloat.FixedPrecisionApfloatHelper helper()
Return the precision helper.- Returns:
- The precision helper.
-
-