RealBox
UnaryPredicates
unary predicates for RealBox objects
IsZero
check whether a RealBox is zero
IsNonzero
check whether a RealBox is nonzero
IsOne
check whether a RealBox is one
IsFinite
check whether a RealBox is finite
IsExact
check whether a RealBox is exact
IsInteger
check whether a RealBox is an integer
IsPositive
check whether a RealBox is positive
IsNegative
check whether a RealBox is negative
IsNonPositive
check whether a RealBox is non-positive
IsNonNegative
check whether a RealBox is non-negative
HasInteger
check whether a RealBox contains an integer value
HasZero
check whether a RealBox contains the value zero
HasPositive
check whether a RealBox contains a positive value
HasNegative
check whether a RealBox contains a negative value
HasNonNegative
check whether a RealBox contains a non-negative value
HasNonPositive
check whether a RealBox contains a non-positive value
IsInfinity
check whether a RealBox is positive infinity
IsNegInfinity
check whether a RealBox is negative infinity
IsUndefined
check whether a RealBox is undefined
Calling Sequence
Parameters
Description
Examples
Compatibility
IsZero( b )
IsNonzero( b )
IsOne( b )
IsFinite( b )
IsExact( b )
IsInteger( b )
IsPositive( b )
IsNegative( b )
IsNonPositive( b )
IsNonNegative( b )
IsUndefined( b )
IsInfinity( b )
IsNegInfinity( b )
HasInteger( b )
HasZero( b )
HasPositive( b )
HasNegative( b )
HasNonNegative( b )
HasNonPositive( b )
b
-
RealBox object
precopt
(optional) equation of the form precision = n, where n is a positive integer
Each RealBox object defines a number of predicates that can be used to query various properties of the box.
Predicates may be further sub-divided into unary predicates (of a single RealBox object) or binary (for comparing two RealBox objects).
The following table describes briefly the unary predicate methods defined for RealBox objects.
Predicate
returns true if the RealBox represents an exact zero (center and radius are both 0)
returns true if the RealBox does not contain 0
returns true if the RealBox represents 1 exactly
returns true if the RealBox has finite center and radius
returns true if the RealBox has zero radius
returns true if the RealBox has zero radius and integer center
returns true if every member of the RealBox is positive (false if it contains undefined)
returns true if every member of the RealBox is negative (false if it contains undefined)
returns true if every member of the RealBox is non-negative (false if it contains undefined)
returns true if every member of the RealBox is non-positive (false if it contains undefined)
returns true if the RealBox is positive infinity
returns true if the RealBox is negative infinity
returns true if the RealBox is an undefined (NaN)
returns true if the RealBox contains an integer value
returns true if the RealBox contains 0
returns true if the RealBox contains a positive value
returns true if the RealBox contains a negative value
returns true if the RealBox contains a non-negative value
returns true if the RealBox contains a non-positive value
Use the 'precision' = n option to control the precision used in these methods. For more details on precision, see BoxPrecision.
The following results are not surprising.
IsZero⁡RealBox⁡0
true
IsZero⁡RealBox⁡0.
This returns false because the box is not an exact zero.
IsZero⁡RealBox⁡0.,1.×10−30
false
Clearly, 0 is contained in the following box.
IsNonzero⁡RealBox⁡0.,1.×10−30
That zero belongs to the next box is due to the box being closed.
IsNonzero⁡RealBox⁡1.×10−30,1.×10−30
IsNonzero⁡RealBox⁡1.×10−30,1.×10−31
IsOne⁡RealBox⁡1
IsOne⁡RealBox⁡1.0
This returns false because the box is not an exact box.
IsOne⁡RealBox⁡1.0,1.×10−30
IsFinite⁡RealBox⁡2.3
A box is not finite despite having a finite center if its radius is infinite.
IsFinite⁡RealBox⁡2.3,∞
Negative infinities are also not "finite".
IsFinite⁡RealBox⁡−∞
IsFinite⁡RealBox⁡Float⁡−∞
Undefined values for the center also cause the IsFinite method to return false.
IsFinite⁡RealBox⁡undefined
The IsExact method checks that a RealBox object represents its center exactly in the sense that that radius is equal to 0.
IsExact⁡RealBox⁡0.5
IsExact⁡RealBox⁡0.5,1.×10−50
IsExact⁡RealBox⁡∞
IsExact⁡RealBox⁡−∞
IsExact⁡RealBox⁡undefined
Whether a RealBox object is exact may depend not only on the passed radius (which is 0 by default), but also on the representability of the center as an exact float. In these examples, the rational number 32 can be represented exactly as a float, while 23 cannot.
IsExact⁡RealBox⁡32
IsExact⁡RealBox⁡23
Notice that IsInteger returns true only if the RealBox is exact in the sense that the radius is equal to 0.
IsInteger⁡RealBox⁡44
IsInteger⁡RealBox⁡44,1.×10−40
Of course, it returns false for (exact) non-integral values.
IsInteger⁡RealBox⁡32
IsInteger⁡RealBox⁡∞
IsInteger⁡RealBox⁡−∞
IsInteger⁡RealBox⁡undefined
The following returns true because the default user-specified radius of zero results in an ultimate radius that is very small relative to the size of the center.
IsPositive⁡RealBox⁡0.0001
Radius⁡RealBox⁡0.0001
7.10542735760100×10−15
Here, the radius is larger than the center, so the box represents a set containing non-positive values.
IsPositive⁡RealBox⁡0.0001,0.001
Similar results are obtained for testing whether a box is "negative".
IsNegative⁡RealBox⁡0.001
IsNegative⁡RealBox⁡−0.001
IsNegative⁡RealBox⁡−0.001,0.02
IsNonNegative⁡RealBox⁡0
IsNonNegative⁡RealBox⁡0,1.×10−34
IsNonNegative⁡RealBox⁡1.×10−34,1.×10−35
IsNonNegative⁡RealBox⁡1.×10−34,1.×10−34
IsNonPositive⁡RealBox⁡0
Note the result for a negative zero:
IsNonPositive⁡RealBox⁡−0.
IsNonPositive⁡RealBox⁡0,1.×10−20
IsNonPositive⁡RealBox⁡−1.×10−20,1.×10−20
IsNonPositive⁡RealBox⁡−1.×10−20,1.×10−21
HasInteger⁡RealBox⁡0
HasInteger⁡RealBox⁡0,1.×10−30
HasInteger⁡RealBox⁡−273.15,0.00001
HasInteger⁡RealBox⁡−273.15,0.2
HasInteger⁡RealBox⁡808017424794512875886459904961710757005754368000000000,1.×10−40
HasInteger⁡RealBox⁡106!,1.×10−1000
HasZero⁡RealBox⁡0
HasZero⁡RealBox⁡−0.
HasZero⁡RealBox⁡1.×10−30,1.×10−31
HasZero⁡RealBox⁡1.×10−30,1.×10−30
HasPositive⁡RealBox⁡0
HasPositive⁡RealBox⁡0,1.×10−30
HasPositive⁡RealBox⁡−1.×10−29,1.×10−30
Because neither the center nor radius can be represented exactly in floating point, the following returns true.
HasPositive⁡RealBox⁡−1.×10−20,1.×10−20
Similarly, we have the following result.
HasNegative⁡RealBox⁡1.×10−20,1.×10−20
HasNegative⁡RealBox⁡0
HasNegative⁡RealBox⁡0,1.×10−40
HasNegative⁡RealBox⁡1.×10−39,1.×10−40
HasNonNegative⁡RealBox⁡0
HasNonNegative⁡RealBox⁡−1.×10−20,1.×10−20
HasNonNegative⁡RealBox⁡−1.×10−20,1.×10−21
HasNonPositive⁡RealBox⁡0
IsInfinity⁡RealBox⁡∞
IsInfinity⁡RealBox⁡0,∞
IsInfinity⁡RealBox⁡−∞
IsNegInfinity⁡RealBox⁡−∞
IsUndefined⁡RealBox⁡Float⁡undefined
The RealBox[UnaryPredicates], RealBox:-IsZero, RealBox:-IsNonzero, RealBox:-IsOne, RealBox:-IsFinite, RealBox:-IsExact, RealBox:-IsInteger, RealBox:-IsPositive, RealBox:-IsNegative, RealBox:-IsNonPositive, RealBox:-IsNonNegative, RealBox:-HasInteger, RealBox:-HasZero, RealBox:-HasPositive, RealBox:-HasNegative, RealBox:-HasNonNegative, RealBox:-HasNonPositive, RealBox:-IsInfinity, RealBox:-IsNegInfinity and RealBox:-IsUndefined commands were introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
See Also
ComplexBox
RealBox[BinaryPredicates]
Download Help Document