- All Superinterfaces:
Comparable<PsyRealNumeric>
,PsyAdditive<PsyNumeric>
,PsyArithmetic<PsyNumeric>
,PsyAtomic
,PsyConvertableToInteger
,PsyConvertableToIntegral
,PsyConvertableToRational
,PsyConvertableToReal
,PsyMultiplicative<PsyNumeric>
,PsyNumeric
,PsyObject
,PsyRealNumeric
,PsyScalar<PsyRealNumeric>
- All Known Subinterfaces:
PsyIntegral
- All Known Implementing Classes:
PsyBigFraction
,PsyBigInteger
,PsyFraction
,PsyInteger
@Type("rational")
public sealed interface PsyRational
extends PsyRealNumeric
permits PsyIntegral, PsyFraction, PsyBigFraction
The representation of
rational
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextAction
Context action of thedenominator
operator.static final ContextAction
Context action of thenumerator
operator.Fields inherited from interface coneforest.psylla.core.PsyAdditive
PSY_ADD, PSY_ISZERO, PSY_NEG, PSY_NONZERO, PSY_SUB
Fields inherited from interface coneforest.psylla.core.PsyConvertableToInteger
PSY_TOINTEGER
Fields inherited from interface coneforest.psylla.core.PsyConvertableToIntegral
PSY_TOINTEGRAL
Fields inherited from interface coneforest.psylla.core.PsyConvertableToRational
PSY_TORATIONAL
Fields inherited from interface coneforest.psylla.core.PsyConvertableToReal
PSY_TOREAL
Fields inherited from interface coneforest.psylla.core.PsyMultiplicative
PSY_DIV, PSY_MUL, PSY_RECIPROCAL
Fields inherited from interface coneforest.psylla.core.PsyNumeric
PSY_ABS, PSY_ACOS, PSY_ASIN, PSY_ATAN, PSY_CBRT, PSY_COS, PSY_COSH, PSY_EXP, PSY_LOG, PSY_POW, PSY_SIGNUM, PSY_SIN, PSY_SINH, PSY_SQRT, PSY_TAN, PSY_TANH
Fields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPE
Fields inherited from interface coneforest.psylla.core.PsyRealNumeric
PSY_CEILING, PSY_FLOOR, PSY_HYPOT, PSY_ROUND
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
compareTo
(PsyRealNumeric oNumeric) static PsyRational
of
(PsyIntegral oNumerator, PsyIntegral oDenominator) static PsyRational
parseLiteral
(String image) default PsyRational
psyAbs()
Returns thenumeric
absolute value of this object.default PsyRealNumeric
psyAdd
(PsyRealNumeric oRealNumeric) Returns anintegral
denominator of this fraction.default PsyRealNumeric
psyDiv
(PsyRealNumeric oRealNumeric) psyFloor()
default PsyRealNumeric
psyMul
(PsyRealNumeric oRealNumeric) default PsyRational
psyNeg()
Returns theadditive
result of arithmetic negation of this object.Returns anintegral
numerator of this fraction.default PsyRational
default PsyRealNumeric
psySub
(PsyRealNumeric oRealNumeric) default PsyRational
default PsyRational
Methods inherited from interface coneforest.psylla.core.PsyAdditive
psyIsZero, psyNonZero
Methods inherited from interface coneforest.psylla.core.PsyConvertableToIntegral
psyToIntegral
Methods inherited from interface coneforest.psylla.core.PsyNumeric
psySignum
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, toSyntaxString, typeName
Methods inherited from interface coneforest.psylla.core.PsyRealNumeric
doubleValue, imagValue, intValue, longValue, psyAcos, psyAdd, psyAsin, psyAtan, psyCbrt, psyCos, psyCosh, psyDiv, psyEq, psyExp, psyHypot, psyLog, psyMul, psyPow, psyPow, psyRound, psySin, psySinh, psySqrt, psySub, psyTan, psyTanh, psyToInteger, psyToReal, realValue
-
Field Details
-
PSY_NUMERATOR
Context action of thenumerator
operator. -
PSY_DENOMINATOR
Context action of thedenominator
operator.
-
-
Method Details
-
bigIntegerValue
BigInteger bigIntegerValue() -
rationalValue
- Specified by:
rationalValue
in interfacePsyRealNumeric
-
psyNumerator
PsyIntegral psyNumerator()Returns anintegral
numerator of this fraction.- Returns:
- the numerator.
-
psyDenominator
PsyIntegral psyDenominator()Returns anintegral
denominator of this fraction.- Returns:
- the denominator.
-
psyToRational
- Specified by:
psyToRational
in interfacePsyConvertableToRational
- Specified by:
psyToRational
in interfacePsyRealNumeric
-
psyNeg
Description copied from interface:PsyAdditive
Returns theadditive
result of arithmetic negation of this object.- Specified by:
psyNeg
in interfacePsyAdditive<PsyNumeric>
- Specified by:
psyNeg
in interfacePsyRealNumeric
- Returns:
- the
additive
result of arithmetic negation.
-
psyAdd
- Specified by:
psyAdd
in interfacePsyRealNumeric
-
psySub
- Specified by:
psySub
in interfacePsyRealNumeric
-
psyReciprocal
- Specified by:
psyReciprocal
in interfacePsyMultiplicative<PsyNumeric>
- Throws:
PsyUndefinedResultException
-
psyMul
- Specified by:
psyMul
in interfacePsyRealNumeric
-
psyDiv
- Specified by:
psyDiv
in interfacePsyRealNumeric
- Throws:
PsyUndefinedResultException
-
psyCeiling
PsyIntegral psyCeiling()- Specified by:
psyCeiling
in interfacePsyRealNumeric
-
psyAbs
Description copied from interface:PsyNumeric
Returns thenumeric
absolute value of this object.- Specified by:
psyAbs
in interfacePsyNumeric
- Specified by:
psyAbs
in interfacePsyRealNumeric
- Returns:
- the
numeric
absolute value.
-
psyFloor
PsyIntegral psyFloor()- Specified by:
psyFloor
in interfacePsyRealNumeric
-
of
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PsyRealNumeric>
- Specified by:
compareTo
in interfacePsyRealNumeric
- Specified by:
compareTo
in interfacePsyScalar<PsyRealNumeric>
-
parseLiteral
static PsyRational parseLiteral(String image) throws PsySyntaxErrorException, PsyUndefinedResultException
-