Class PsyFraction
java.lang.Object
coneforest.psylla.core.PsyFraction
- All Implemented Interfaces:
PsyAdditive<PsyNumeric>, PsyArithmetic<PsyNumeric>, PsyConvertableToInteger, PsyConvertableToIntegral, PsyConvertableToRational, PsyConvertableToReal, PsyMultiplicative<PsyNumeric>, PsyNumeric, PsyObject, PsyRational, PsyRealNumeric, PsyScalar<PsyRealNumeric>, PsyValue, Comparable<PsyRealNumeric>
The representation of
fraction.-
Field Summary
Fields inherited from interface PsyAdditive
PSY_ADD, PSY_ISZERO, PSY_NEG, PSY_NONZERO, PSY_SUBFields inherited from interface PsyConvertableToInteger
PSY_TOINTEGERFields inherited from interface PsyConvertableToIntegral
PSY_TOINTEGRALFields inherited from interface PsyConvertableToRational
PSY_TORATIONALFields inherited from interface PsyConvertableToReal
PSY_TOREALFields inherited from interface PsyMultiplicative
PSY_DIV, PSY_MUL, PSY_RECIPROCALFields inherited from interface 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_TANHFields inherited from interface PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TOSTRING, PSY_TOSTRINGBUFFER, PSY_TYPEFields inherited from interface PsyRational
PSY_DENOMINATOR, PSY_GCD, PSY_IDIV, PSY_LCM, PSY_MOD, PSY_NUMERATORFields inherited from interface PsyRealNumeric
PSY_CEILING, PSY_FLOOR, PSY_HYPOT, PSY_ROUND -
Method Summary
Modifier and TypeMethodDescriptiondoubleintintValue()booleanisZero()longstatic PsyRationalof(long numerator, long denominator) Returns anintegraldenominator of this fraction.psyFloor()Returns anintegralnumerator of this fraction.Returns thenumericsignum of this object.Returns the syntactic representation of this object.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PsyAdditive
psyIsZero, psyNonZeroMethods inherited from interface PsyObject
convert, execute, invoke, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToString, psyToStringBuffer, psyType, typeNameMethods inherited from interface PsyRational
compareTo, psyAbs, psyAdd, psyDiv, psyGCD, psyIdiv, psyLCM, psyMod, psyMul, psyNeg, psyReciprocal, psyRound, psySub, psyToIntegral, psyToRational, rationalValue
-
Method Details
-
of
- Throws:
IllegalArgumentException
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein interfacePsyRealNumeric
-
bigIntegerValue
- Specified by:
bigIntegerValuein interfacePsyRational
-
longValue
public long longValue()- Specified by:
longValuein interfacePsyRealNumeric
-
intValue
public int intValue()- Specified by:
intValuein interfacePsyRealNumeric
-
psyNumerator
Description copied from interface:PsyRationalReturns anintegralnumerator of this fraction.- Specified by:
psyNumeratorin interfacePsyRational- Returns:
- an
integralnumerator of this fraction
-
psyDenominator
Description copied from interface:PsyRationalReturns anintegraldenominator of this fraction.- Specified by:
psyDenominatorin interfacePsyRational- Returns:
- an
integraldenominator of this fraction
-
psyFloor
- Specified by:
psyFloorin interfacePsyRational- Specified by:
psyFloorin interfacePsyRealNumeric
-
psyCeiling
- Specified by:
psyCeilingin interfacePsyRational- Specified by:
psyCeilingin interfacePsyRealNumeric
-
isZero
public boolean isZero()- Specified by:
isZeroin interfacePsyAdditive<PsyNumeric>
-
psySignum
Description copied from interface:PsyNumericReturns thenumericsignum of this object.- Specified by:
psySignumin interfacePsyNumeric- Returns:
- the
numericsignum of this object
-
toSyntaxString
Description copied from interface:PsyObjectReturns the syntactic representation of this object.- Specified by:
toSyntaxStringin interfacePsyObject- Returns:
- the syntactic representation of this object
-