java.lang.Object
coneforest.psylla.core.PsyReal
- All Implemented Interfaces:
PsyAdditive<PsyNumeric>
,PsyArithmetic<PsyNumeric>
,PsyConvertableToInteger
,PsyConvertableToIntegral
,PsyConvertableToRational
,PsyConvertableToReal
,PsyMultiplicative<PsyNumeric>
,PsyNumeric
,PsyObject
,PsyRealNumeric
,PsyScalar<PsyRealNumeric>
,PsyValue
,Comparable<PsyRealNumeric>
The representation of
real
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PsyReal
The number e.static final PsyReal
The largest positive finite value, (2−−52)·21023.static final PsyReal
The smallest positive nonzero value, 2−1074.static final PsyReal
The number minus one.static final PsyReal
The Not-a-Number (NaN) value.static final PsyReal
The number one.static final PsyReal
The number π.static final PsyReal
The number two.static final PsyReal
The number zero.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_TOSTRING, PSY_TOSTRINGBUFFER, PSY_TYPE
Fields inherited from interface coneforest.psylla.core.PsyRealNumeric
PSY_CEILING, PSY_FLOOR, PSY_HYPOT, PSY_ROUND
-
Constructor Summary
ConstructorsConstructorDescriptionPsyReal
(double value) Creates a newreal
representing the specifieddouble
value. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(PsyRealNumeric oNumeric) Compares thisscalar
with the specifiedscalar
for order.double
boolean
int
hashCode()
int
intValue()
boolean
isZero()
long
static PsyReal
parseLiteral
(String image) Returns thereal
initialized to the value represented by the specifiedString
image.psyAbs()
Returns thenumeric
absolute value of this object.psyAdd
(PsyRealNumeric oNumeric) psyDiv
(PsyRealNumeric oRealNumeric) psyFloor()
psyMul
(PsyRealNumeric oRealNumeric) psyNeg()
Returns theadditive
result of arithmetic negation of this object.Returns the multiplicative inverse of this object.psyRound()
Returns thenumeric
signum of this object.psySub
(PsyRealNumeric oNumeric) Returns the syntactic representation of this object.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface coneforest.psylla.core.PsyAdditive
psyIsZero, psyNonZero
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToString, psyToStringBuffer, psyType, typeName
Methods inherited from interface coneforest.psylla.core.PsyRealNumeric
imagValue, psyAcos, psyAdd, psyAsin, psyAtan, psyCbrt, psyCos, psyCosh, psyDiv, psyEq, psyExp, psyHypot, psyLog, psyMul, psyPow, psyPow, psySin, psySinh, psySqrt, psySub, psyTan, psyTanh, psyToInteger, psyToRational, psyToReal, realValue
-
Field Details
-
ZERO
The number zero. -
ONE
The number one. -
TWO
The number two. -
MINUS_ONE
The number minus one. -
PI
The number π. -
E
The number e. -
MAX_VALUE
The largest positive finite value, (2−−52)·21023. -
MIN_VALUE
The smallest positive nonzero value, 2−1074. -
NAN
The Not-a-Number (NaN) value.
-
-
Constructor Details
-
PsyReal
public PsyReal(double value) Creates a newreal
representing the specifieddouble
value.- Parameters:
value
- adouble
value.
-
-
Method Details
-
psyToIntegral
- Specified by:
psyToIntegral
in interfacePsyConvertableToIntegral
- Throws:
PsyRangeCheckException
-
isZero
public boolean isZero()- Specified by:
isZero
in interfacePsyAdditive<PsyNumeric>
-
intValue
public int intValue()- Specified by:
intValue
in interfacePsyRealNumeric
-
longValue
public long longValue()- Specified by:
longValue
in interfacePsyRealNumeric
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in interfacePsyRealNumeric
-
rationalValue
- Specified by:
rationalValue
in interfacePsyRealNumeric
- Throws:
PsyUndefinedResultException
-
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 of this object
-
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 of this object
-
psySignum
Description copied from interface:PsyNumeric
Returns thenumeric
signum of this object.- Specified by:
psySignum
in interfacePsyNumeric
- Returns:
- the
numeric
signum of this object
-
psyAdd
- Specified by:
psyAdd
in interfacePsyRealNumeric
-
psySub
- Specified by:
psySub
in interfacePsyRealNumeric
-
psyReciprocal
Description copied from interface:PsyMultiplicative
Returns the multiplicative inverse of this object.- Specified by:
psyReciprocal
in interfacePsyMultiplicative<PsyNumeric>
- Returns:
- the multiplicative inverse of this object
-
psyMul
- Specified by:
psyMul
in interfacePsyRealNumeric
-
psyDiv
- Specified by:
psyDiv
in interfacePsyRealNumeric
-
psyRound
- Specified by:
psyRound
in interfacePsyRealNumeric
-
psyFloor
- Specified by:
psyFloor
in interfacePsyRealNumeric
-
psyCeiling
- Specified by:
psyCeiling
in interfacePsyRealNumeric
-
compareTo
Description copied from interface:PsyScalar
Compares thisscalar
with the specifiedscalar
for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specifiedscalar
.- Specified by:
compareTo
in interfaceComparable<PsyRealNumeric>
- Specified by:
compareTo
in interfacePsyRealNumeric
- Specified by:
compareTo
in interfacePsyScalar<PsyRealNumeric>
- Parameters:
oNumeric
- thescalar
to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified.
-
toSyntaxString
Description copied from interface:PsyObject
Returns the syntactic representation of this object.- Specified by:
toSyntaxString
in interfacePsyObject
- Returns:
- the syntactic representation of this object
-
hashCode
public int hashCode() -
equals
-
parseLiteral
Returns thereal
initialized to the value represented by the specifiedString
image.- Parameters:
image
- the string to be parsed.- Returns:
- the
real
initialized to the value represented by the specifiedString
image
-