Package org.apfloat.jscience
Class AprationalField
- All Implemented Interfaces:
Serializable,Comparable<AprationalField>,Immutable,Realtime,ValueType,XMLSerializable,Field<AprationalField>,GroupAdditive<AprationalField>,GroupMultiplicative<AprationalField>,Ring<AprationalField>,Structure<AprationalField>
This class represents an arbitrary precision rational number.
- Since:
- 1.8.0
- Version:
- 1.8.0
- Author:
- Mikko Tommila
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAprationalField(Aprational value) Constructs a new rational 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(AprationalField that) Returns the sum of this object with the one specified.times(AprationalField 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, valueMethods inherited from class org.jscience.mathematics.number.Number
byteValue, floatValue, intValue, isGreaterThan, isLessThan, minus, pow, shortValue, toString
-
Constructor Details
-
AprationalField
Constructs a new rational field object with the specified value.- Parameters:
value- The value.
-
-
Method Details
-
plus
Description copied from class:AbstractFieldReturns the sum of this object with the one specified.- Specified by:
plusin interfaceGroupAdditive<AprationalField>- Specified by:
plusin classAbstractField<AprationalField,Aprational> - Parameters:
that- The addend.- Returns:
this + that
-
opposite
Description copied from class:AbstractFieldReturns the additive inverse of this object.- Specified by:
oppositein interfaceGroupAdditive<AprationalField>- Specified by:
oppositein classAbstractField<AprationalField,Aprational> - Returns:
-this
-
times
Description copied from class:AbstractFieldReturns the product of this object with the one specified.- Specified by:
timesin interfaceGroupMultiplicative<AprationalField>- Specified by:
timesin interfaceRing<AprationalField>- Specified by:
timesin classAbstractField<AprationalField,Aprational> - Parameters:
that- The multiplicand.- Returns:
this * that
-
inverse
Description copied from class:AbstractFieldReturns the multiplicative inverse of this object.- Specified by:
inversein interfaceGroupMultiplicative<AprationalField>- Specified by:
inversein classAbstractField<AprationalField,Aprational> - Returns:
1 / this- Throws:
ArithmeticException- If the divisor is zero.
-
copy
Description copied from class:AbstractFieldReturns a copy of this object.- Specified by:
copyin interfaceValueType- Specified by:
copyin classAbstractField<AprationalField,Aprational> - Returns:
- A copy of this object.
-