- All Superinterfaces:
PsyAdditive<PsyNumeric>
,PsyArithmetic<PsyNumeric>
,PsyAtomic
,PsyConvertableToInteger
,PsyConvertableToIntegral
,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.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_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
cmp
(PsyRealNumeric oNumeric) static PsyRational
of
(PsyIntegral oNumerator, PsyIntegral oDenominator) static PsyRational
parseLiteral
(String image) default PsyRational
psyAbs()
Returns anumeric
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 anadditive
representing the result of arithmetic negation of this object.Returns anintegral
numerator of this fraction.default PsyRational
default PsyRealNumeric
psySub
(PsyRealNumeric oRealNumeric) 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, psyCmp, psyCos, psyCosh, psyDiv, psyEq, psyExp, psyGe, psyGt, psyHypot, psyLe, psyLog, psyLt, 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() -
psyNumerator
PsyIntegral psyNumerator()Returns anintegral
numerator of this fraction.- Returns:
- the numerator.
-
psyDenominator
PsyIntegral psyDenominator()Returns anintegral
denominator of this fraction.- Returns:
- the denominator.
-
psyNeg
Description copied from interface:PsyAdditive
Returns anadditive
representing the result of arithmetic negation of this object.- Specified by:
psyNeg
in interfacePsyAdditive<PsyNumeric>
- Specified by:
psyNeg
in interfacePsyRealNumeric
- Returns:
- a 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 anumeric
absolute value of this object.- Specified by:
psyAbs
in interfacePsyNumeric
- Specified by:
psyAbs
in interfacePsyRealNumeric
- Returns:
- a
numeric
absolute value.
-
psyFloor
PsyIntegral psyFloor()- Specified by:
psyFloor
in interfacePsyRealNumeric
-
of
-
cmp
- Specified by:
cmp
in interfacePsyRealNumeric
-
parseLiteral
static PsyRational parseLiteral(String image) throws PsySyntaxErrorException, PsyUndefinedResultException
-