org.matheclipse.core.interfaces
Interface ISignedNumber
-
- All Superinterfaces:
- AbelianGroupElem<IExpr>, java.lang.Comparable<IExpr>, Element<IExpr>, IExpr, INumber, MonoidElem<IExpr>, RingElem<IExpr>, java.io.Serializable
- All Known Implementing Classes:
- FractionSym, IntegerSym, Num
public interface ISignedNumber extends INumber
interface for "ractional" numbers (i.e. IInteger or IFraction)
-
-
Field Summary
-
Fields inherited from interface org.matheclipse.core.interfaces.IExpr
ASTID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description IIntegerceil()Returns the smallest (closest to negative infinity)IIntegervalue that is not less thanthisand is equal to a mathematical integer.ISignedNumberdivideBy(ISignedNumber that)Dividethissigned number bythatsigned number.doubledoubleValue()IIntegerfloor()Returns the largest (closest to positive infinity)IIntegervalue that is not greater thanthisand is equal to a mathematical integer.ISignedNumberinverse()Returns the multiplicative inverse of this object.booleanisGreaterThan(ISignedNumber that)booleanisLessThan(ISignedNumber that)booleanisNegative()Test if this number is negative.booleanisPositive()Test if this number is positive.booleanisZero()Test if this expression equals0in symbolic or numeric mode.ISignedNumbernegate()Returns (-1) * thisISignedNumberopposite()IIntegerround()Returns the closestIIntegerto the argument.intsign()Returns the signum function of this number (i.e., -1, 0 or 1 as the value of this number is negative, zero or positive).ISignedNumbersubtractFrom(ISignedNumber that)Subtractthatsigned number fromthissigned numberinttoInt()Converts this number toint; unlike#intValuethis method raisesArithmeticExceptionif this number cannot be represented by aninttype.longtoLong()Converts this number tolong; unlike#longValuethis method raisesArithmeticExceptionif this number cannot be represented by anlongtype.-
Methods inherited from interface org.matheclipse.core.interfaces.INumber
complexSign, eabs, equalsInt, getIm, getRe
-
Methods inherited from interface org.matheclipse.core.interfaces.IExpr
accept, accept, accept, and, apply, apply, asType, compareTo, evaluate, fullFormString, getAt, head, hierarchy, internalFormString, isAnd, isArcCos, isArcCosh, isArcSin, isArcSinh, isArcTan, isArcTanh, isAST, isAST, isAST, isAST, isAST, isAST, isASTSizeGE, isAtom, isComplex, isComplexInfinity, isComplexNumeric, isCondition, isConstant, isCos, isCosh, isDirectedInfinity, isFalse, isFlatAST, isFraction, isFree, isFree, isFunction, isGEOrdered, isGTOrdered, isInfinity, isInteger, isLEOrdered, isList, isListOfLists, isLog, isLTOrdered, isMatrix, isMember, isMember, isMinusOne, isModule, isNegativeInfinity, isNot, isNumber, isNumEqualInteger, isNumeric, isNumericFunction, isNumIntValue, isOne, isOr, isOrderlessAST, isPattern, isPatternExpr, isPatternSequence, isPlus, isPower, isRational, isRealFunction, isRuleAST, isSame, isSame, isSequence, isSignedNumber, isSin, isSinh, isSlot, isSlotSequence, isSymbol, isTan, isTanh, isTimes, isTrue, isValue, isVector, leaves, minus, mod, multiply, negative, or, plus, power, power, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceSlots, signum, times, topHead, variables2Slots
-
Methods inherited from interface edu.jas.structure.AbelianGroupElem
abs, isZERO, subtract, sum
-
Methods inherited from interface edu.jas.structure.MonoidElem
divide, isONE, isUnit, remainder
-
-
-
-
Method Detail
-
isNegative
boolean isNegative()
Test if this number is negative.- Specified by:
isNegativein interfaceIExpr- Returns:
true, ifthis < 0
-
isPositive
boolean isPositive()
Test if this number is positive.- Specified by:
isPositivein interfaceIExpr- Returns:
true, ifthis > 0
-
isZero
boolean isZero()
Test if this expression equals0in symbolic or numeric mode.
-
isLessThan
boolean isLessThan(ISignedNumber that)
-
isGreaterThan
boolean isGreaterThan(ISignedNumber that)
-
negate
ISignedNumber negate()
Returns (-1) * this- Specified by:
negatein interfaceAbelianGroupElem<IExpr>- Returns:
-
divideBy
ISignedNumber divideBy(ISignedNumber that)
Dividethissigned number bythatsigned number.- Parameters:
that- a signed number- Returns:
-
subtractFrom
ISignedNumber subtractFrom(ISignedNumber that)
Subtractthatsigned number fromthissigned number- Parameters:
that- a signed number- Returns:
-
sign
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).- Returns:
- -1 if this is a negative number;
0 if this is a zero;
-1 if this is a negative number;
-
toInt
int toInt() throws java.lang.ArithmeticException
Converts this number toint; unlike#intValuethis method raisesArithmeticExceptionif this number cannot be represented by aninttype.- Returns:
- the numeric value represented by this integer after conversion to type
int. - Throws:
java.lang.ArithmeticException- if conversion tointis not possible.
-
toLong
long toLong() throws java.lang.ArithmeticExceptionConverts this number tolong; unlike#longValuethis method raisesArithmeticExceptionif this number cannot be represented by anlongtype.- Returns:
- the numeric value represented by this integer after conversion to type
long. - Throws:
java.lang.ArithmeticException- if conversion tointis not possible.
-
ceil
IInteger ceil() throws java.lang.ArithmeticException
Returns the smallest (closest to negative infinity)IIntegervalue that is not less thanthisand is equal to a mathematical integer. This method raisesArithmeticExceptionif a numeric value cannot be represented by anlongtype.- Returns:
- the smallest (closest to negative infinity)
IIntegervalue that is not less thanthisand is equal to a mathematical integer. - Throws:
java.lang.ArithmeticException
-
floor
IInteger floor() throws java.lang.ArithmeticException
Returns the largest (closest to positive infinity)IIntegervalue that is not greater thanthisand is equal to a mathematical integer.
This method raisesArithmeticExceptionif a numeric value cannot be represented by anlongtype.- Returns:
- the largest (closest to positive infinity)
IIntegervalue that is not greater thanthisand is equal to a mathematical integer. - Throws:
java.lang.ArithmeticException
-
round
IInteger round()
Returns the closestIIntegerto the argument. The result is rounded to an integer by adding 1/2 and taking the floor of the result.
This method raisesArithmeticExceptionif a numeric value cannot be represented by anlongtype.- Returns:
- the closest integer to the argument.
-
inverse
ISignedNumber inverse()
Description copied from interface:IExprReturns the multiplicative inverse of this object. It is the object such asthis.times(this.inverse()) == ONE, withONEbeing the multiplicative identity.- Specified by:
inversein interfaceIExpr- Specified by:
inversein interfaceMonoidElem<IExpr>- Returns:
ONE / this.
-
opposite
ISignedNumber opposite()
-
doubleValue
double doubleValue()
-
-
DMelt 3.0 © DataMelt by jWork.ORG