Package coneforest.psylla.core
Class PsyFractional
java.lang.Object
coneforest.psylla.core.PsyFractional
- All Implemented Interfaces:
PsyAdditive<PsyNumeric>
,PsyArithmetic<PsyNumeric>
,PsyAtomic
,PsyConvertableToInteger
,PsyConvertableToIntegral
,PsyConvertableToName
,PsyConvertableToReal
,PsyConvertableToString
,PsyMultiplicative<PsyNumeric>
,PsyNumeric
,PsyObject
,PsyRational
,PsyRealNumeric
,PsyScalar<PsyRealNumeric>
-
Field Summary
Fields inherited from interface coneforest.psylla.core.PsyRational
OPERATORS
-
Method Summary
Modifier and TypeMethodDescriptiondouble
int
intValue()
long
static PsyRational
of
(long numerator, long denominator) psyAbs()
Returns anumeric
absolute value of this object.psyAdd
(PsyRealNumeric oRealNumeric) psyCmp
(PsyRealNumeric oRealNumeric) Compares this object against given object and returns aninteger
indicating the result of the comparison.Returns anintegral
representing a denominator of this fraction.psyDiv
(PsyRealNumeric oRealNumeric) psyFloor()
Returns aboolean
indicating whether this object represents a zero value.psyMul
(PsyRealNumeric oRealNumeric) psyNeg()
Returns anadditive
representing the result of arithmetic negation of this object.Returns anintegral
representing a numerator of this fraction.psyRound()
Returns the signum of this object.psySub
(PsyRealNumeric oRealNumeric) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface coneforest.psylla.core.PsyAdditive
psyNotZero
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
Methods inherited from interface coneforest.psylla.core.PsyRational
cmp
Methods inherited from interface coneforest.psylla.core.PsyRealNumeric
imagValue, psyAcos, psyAdd, psyAsin, psyAtan, psyCbrt, psyCos, psyCosh, psyDiv, psyEq, psyExp, psyGe, psyGt, psyHypot, psyLe, psyLog, psyLt, psyMul, psyPow, psyPow, psySin, psySinh, psySqrt, psySub, psyTan, psyTanh, psyToInteger, psyToReal, realValue
-
Method Details
-
of
- Throws:
PsyUndefinedResultException
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in interfacePsyRealNumeric
-
bigIntegerValue
- Specified by:
bigIntegerValue
in interfacePsyRational
-
longValue
public long longValue()- Specified by:
longValue
in interfacePsyRealNumeric
-
intValue
public int intValue()- Specified by:
intValue
in interfacePsyRealNumeric
-
psyNumerator
Description copied from interface:PsyRational
Returns anintegral
representing a numerator of this fraction.- Specified by:
psyNumerator
in interfacePsyRational
- Returns:
- the numerator.
-
psyDenominator
Description copied from interface:PsyRational
Returns anintegral
representing a denominator of this fraction.- Specified by:
psyDenominator
in interfacePsyRational
- Returns:
- the denominator.
-
psyFloor
- Specified by:
psyFloor
in interfacePsyRational
- Specified by:
psyFloor
in interfacePsyRealNumeric
-
psyCeiling
- Specified by:
psyCeiling
in interfacePsyRational
- Specified by:
psyCeiling
in interfacePsyRealNumeric
-
psyIsZero
Description copied from interface:PsyAdditive
Returns aboolean
indicating whether this object represents a zero value.- Specified by:
psyIsZero
in interfacePsyAdditive<PsyNumeric>
- Returns:
PsyBoolean.TRUE
if this object represents a zero value, andPsyBoolean.FALSE
otherwise.
-
psyToIntegral
- Specified by:
psyToIntegral
in interfacePsyConvertableToIntegral
-
psyCmp
Description copied from interface:PsyScalar
Compares this object against given object and returns aninteger
indicating the result of the comparison. Returns negative value if this object is less than given one, zero if this object is equal to given one, and positive value if this object is greater than given one.- Specified by:
psyCmp
in interfacePsyRealNumeric
- Specified by:
psyCmp
in interfacePsyScalar<PsyRealNumeric>
- Parameters:
oRealNumeric
- an object with which this object is compared.- Returns:
- a result of the comparison.
-
psyRound
- Specified by:
psyRound
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.
-
psyMul
- Specified by:
psyMul
in interfacePsyRealNumeric
-
psyDiv
- Specified by:
psyDiv
in interfacePsyRealNumeric
- Throws:
PsyUndefinedResultException
-
psyAdd
- Specified by:
psyAdd
in interfacePsyRealNumeric
-
psySub
- Specified by:
psySub
in interfacePsyRealNumeric
-
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.
-
psySignum
Description copied from interface:PsyNumeric
Returns the signum of this object.- Specified by:
psySignum
in interfacePsyNumeric
- Returns:
- the
numeric
signum of this object.
-
toSyntaxString
- Specified by:
toSyntaxString
in interfacePsyObject
-