public interface ISignedNumber extends INumber
ASTID, BLANKID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID
Modifier and Type | Method and Description |
---|---|
ApfloatNum |
apfloatNumValue(long precision)
Get a
Apfloat number wrapped into an ApfloatNum object. |
ISignedNumber |
divideBy(ISignedNumber that)
Divide
this signed number by that signed number. |
double |
doubleValue() |
ISignedNumber |
inverse()
Returns the multiplicative inverse of this object.
|
boolean |
isGreaterThan(ISignedNumber that)
Test if
this signed number is greater than that signed number.. |
boolean |
isLessThan(ISignedNumber that)
Test if
this signed number is less than that signed number.. |
boolean |
isNegative()
Test if this number is negative.
|
boolean |
isPositive()
Test if this number is positive.
|
boolean |
isZero()
Test if this expression equals
0 in symbolic or numeric
mode. |
ISignedNumber |
negate()
Returns (-1) * this
|
Num |
numValue()
Get a Java double number wrapped into a
Num object. |
ISignedNumber |
opposite()
Returns an
IExpr whose value is (-1) * this . |
IInteger |
round()
Returns the closest
IInteger to the argument. |
int |
sign()
Returns the signum function of this number (i.e., -1, 0 or 1 as the value of this number is negative, zero or positive).
|
ISignedNumber |
subtractFrom(ISignedNumber that)
Subtract
that signed number from this signed number |
int |
toInt()
Converts this number to
int ; unlike #intValue this method raises ArithmeticException if this
number cannot be represented by an int type. |
long |
toLong()
Converts this number to
long ; unlike #longValue this method raises ArithmeticException if this
number cannot be represented by an long type. |
apcomplexNumValue, ceilFraction, compareAbsValueToOne, complexNumValue, complexSign, conjugate, eabs, equalsInt, floorFraction, getIm, getImaginary, getRe, getReal
$div, $minus, $plus, $times, $up, accept, accept, accept, accept, and, apply, apply, asType, compareTo, dec, divide, evalComplex, evalDouble, evalNumber, evalSignedNumber, evaluate, evaluateHead, fullFormString, getAt, getField, head, hierarchy, ifPresent, inc, internalFormString, internalJavaString, internalScalaString, isAllExpanded, isAnd, isArcCos, isArcCosh, isArcSin, isArcSinh, isArcTan, isArcTanh, isAST, isAST, isAST, isAST, isAST, isAST, isAST, isASTSizeGE, isAtom, isBlank, isComplex, isComplexInfinity, isComplexNumeric, isCondition, isConstant, isCos, isCosh, isDerivative, isDirectedInfinity, isE, isExpanded, isFalse, isFlatAST, isFraction, isFree, isFree, isFree, isFreeAST, isFreeAST, isFreeOfPatterns, isFunction, isGEOrdered, isGTOrdered, isIndeterminate, isInfinity, isInteger, isIntegerResult, isLEOrdered, isList, isListOfLists, isLog, isLTOrdered, isMatrix, isMember, isMember, isMinusOne, isModule, isNegativeInfinity, isNegativeResult, isNonNegativeResult, isNot, isNumber, isNumEqualInteger, isNumEqualRational, isNumeric, isNumericFunction, isNumericMode, isNumIntValue, isOne, isONE, isOr, isOrderlessAST, isPattern, isPatternDefault, isPatternExpr, isPatternSequence, isPi, isPlus, isPlusTimesPower, isPolynomial, isPolynomial, isPolynomialOfMaxDegree, isPositiveResult, isPower, isPresent, isRational, isRationalResult, isRationalValue, isRealResult, isRuleAST, isSame, isSame, isSequence, isSignedNumber, isSin, isSinh, isSlot, isSlotSequence, isSpan, isSymbol, isTan, isTanh, isTimes, isTrue, isUnit, isValue, isVariable, isVector, isZERO, leafCount, leaves, minus, mod, multiply, multiply, negative, ofNullable, optional, or, orElse, orElseGet, orElseThrow, plus, power, power, reciprocal, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceSlots, signum, subtract, sum, times, timesDistributed, topHead, variables2Slots
ApfloatNum apfloatNumValue(long precision)
Apfloat
number wrapped into an ApfloatNum
object.precision
- set the precision of the resulting ApfloatNumNum numValue()
Num
object.boolean isNegative()
isNegative
in interface IExpr
true
, if this < 0
boolean isPositive()
isPositive
in interface IExpr
true
, if this > 0
boolean isZero()
0
in symbolic or numeric
mode.boolean isLessThan(ISignedNumber that)
this
signed number is less than
that signed number..this < that
boolean isGreaterThan(ISignedNumber that)
this
signed number is greater than
that signed number..this > that
ISignedNumber negate()
ISignedNumber divideBy(ISignedNumber that)
this
signed number by that
signed number.that
- a signed numberISignedNumber subtractFrom(ISignedNumber that)
that
signed number from this
signed numberthat
- a signed numberint sign()
int toInt() throws java.lang.ArithmeticException
int
; unlike #intValue
this method raises ArithmeticException
if this
number cannot be represented by an int
type.int
.java.lang.ArithmeticException
- if conversion to int
is not possible.long toLong() throws java.lang.ArithmeticException
long
; unlike #longValue
this method raises ArithmeticException
if this
number cannot be represented by an long
type.long
.java.lang.ArithmeticException
- if conversion to int
is not possible.IInteger round()
IInteger
to the argument. The result is rounded to an integer by adding 1/2 and taking the
floor of the result.ArithmeticException
if a numeric value cannot be represented by an long
type.ISignedNumber inverse()
IExpr
this.times(this.inverse()) == ONE
, with ONE
being the multiplicative identity. Calculates
F.eval(F.Power(this, F.CN1))
in the common case and uses a
specialized implmentation for derived number classes.ISignedNumber opposite()
IExpr
IExpr
whose value is (-1) * this
.
Calculates F.eval(F.Times(F.CN1, this))
in the common case
and uses a specialized implementation for derived number classes.opposite
in interface IExpr
opposite
in interface INumber
IExpr.negative()
double doubleValue()