Package coneforest.psylla.core
Class PsyReal
- java.lang.Object
-
- coneforest.psylla.core.PsyReal
-
- All Implemented Interfaces:
PsyAdditive<PsyNumeric>
,PsyArithmetic<PsyNumeric>
,PsyAtomic
,PsyConvertableToInteger
,PsyConvertableToName
,PsyConvertableToReal
,PsyConvertableToString
,PsyNumeric
,PsyObject
,PsyRealNumeric
,PsyScalar<PsyRealNumeric>
public class PsyReal extends Object implements PsyRealNumeric
A representation of Ψ-real
object.
-
-
Constructor Summary
Constructors Constructor Description PsyReal(double value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
doubleValue()
boolean
equals(Object object)
int
hashCode()
int
intValue()
long
longValue()
PsyReal
psyAbs()
Returns a Ψ-numeric
absolute value of this object.PsyNumeric
psyAdd(PsyRealNumeric oNumeric)
PsyReal
psyCeiling()
PsyInteger
psyCmp(PsyRealNumeric oNumeric)
Compares this object against given object and returns a Ψ-integer
indicating the result of the comparison.PsyReal
psyFloor()
PsyBoolean
psyIsZero()
Returns a Ψ-boolean
indicating whether this object represents a zero value.PsyNumeric
psyMul(PsyRealNumeric oNumeric)
PsyReal
psyNeg()
Returns a Ψ-additive
representing the result of arithmetic negation of this object.PsyInteger
psyRound()
PsyReal
psySignum()
Returns the signum of this object.PsyNumeric
psySub(PsyRealNumeric oNumeric)
String
toSyntaxString()
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface coneforest.psylla.core.PsyArithmetic
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.PsyRealNumeric
imagValue, psyAcos, psyAdd, psyAsin, psyAtan, psyCbrt, psyCos, psyCosh, psyDiv, psyDiv, psyEq, psyExp, psyGe, psyGt, psyHypot, psyLe, psyLog, psyLt, psyMul, psyPow, psyPow, psySin, psySinh, psySqrt, psySub, psyTan, psyTanh, psyToInteger, psyToReal, realValue
-
-
-
-
Field Detail
-
ZERO
public static final PsyReal ZERO
-
ONE
public static final PsyReal ONE
-
TWO
public static final PsyReal TWO
-
MINUS_ONE
public static final PsyReal MINUS_ONE
-
PI
public static final PsyReal PI
-
E
public static final PsyReal E
-
MAX_VALUE
public static final PsyReal MAX_VALUE
-
MIN_VALUE
public static final PsyReal MIN_VALUE
-
NAN
public static final PsyReal NAN
-
-
Method Detail
-
psyIsZero
public PsyBoolean psyIsZero()
Description copied from interface:PsyArithmetic
Returns a Ψ-boolean
indicating whether this object represents a zero value.- Specified by:
psyIsZero
in interfacePsyArithmetic<PsyNumeric>
- Returns:
PsyBoolean.TRUE
if this object represents a zero value, andPsyBoolean.FALSE
otherwise.
-
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
-
psyNeg
public PsyReal psyNeg()
Description copied from interface:PsyAdditive
Returns a Ψ-additive
representing the result of arithmetic negation of this object.- Specified by:
psyNeg
in interfacePsyAdditive<PsyNumeric>
- Specified by:
psyNeg
in interfacePsyRealNumeric
- Returns:
- a negation.
-
psyAbs
public PsyReal psyAbs()
Description copied from interface:PsyNumeric
Returns a Ψ-numeric
absolute value of this object.- Specified by:
psyAbs
in interfacePsyNumeric
- Specified by:
psyAbs
in interfacePsyRealNumeric
- Returns:
- a Ψ-
numeric
absolute value.
-
psySignum
public PsyReal psySignum()
Description copied from interface:PsyRealNumeric
Returns the signum of this object.- Specified by:
psySignum
in interfacePsyRealNumeric
- Returns:
- the Ψ-
realnumeric
signum of this object.
-
psyAdd
public PsyNumeric psyAdd(PsyRealNumeric oNumeric)
- Specified by:
psyAdd
in interfacePsyRealNumeric
-
psySub
public PsyNumeric psySub(PsyRealNumeric oNumeric)
- Specified by:
psySub
in interfacePsyRealNumeric
-
psyMul
public PsyNumeric psyMul(PsyRealNumeric oNumeric)
- Specified by:
psyMul
in interfacePsyRealNumeric
-
psyRound
public PsyInteger psyRound()
- Specified by:
psyRound
in interfacePsyRealNumeric
-
psyFloor
public PsyReal psyFloor()
- Specified by:
psyFloor
in interfacePsyRealNumeric
-
psyCeiling
public PsyReal psyCeiling()
- Specified by:
psyCeiling
in interfacePsyRealNumeric
-
psyCmp
public PsyInteger psyCmp(PsyRealNumeric oNumeric)
Description copied from interface:PsyScalar
Compares this object against given object and returns a Ψ-integer
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 interfacePsyScalar<PsyRealNumeric>
- Parameters:
oNumeric
- an object with which this object is compared.- Returns:
- a result of the comparison.
-
toSyntaxString
public String toSyntaxString()
- Specified by:
toSyntaxString
in interfacePsyObject
-
-