Predicates - Maple Help

ComplexBox

 Predicates
 predicates for ComplexBox objects
 IsZero
 test whether a ComplexBox object is zero
 HasZero
 test whether a ComplexBox object contains zero
 IsOne
 test whether a ComplexBox object is one
 IsReal
 test whether a ComplexBox object is real
 IsExact
 test whether a ComplexBox object is exact
 IsInteger
 test whether a ComplexBox object is an integer
 HasInteger
 test whether a ComplexBox object contains an integer
 IsFinite
 test whether a ComplexBox object is finite
 IsInfinity
 test whether a ComplexBox object is infinity
 IsUndefined
 test whether a ComplexBox object is undefined
 Equal
 test whether two ComplexBox objects are equal
 Eq
 test whether two ComplexBox objects are equal
 NotEq
 test whether two ComplexBox objects are not equal
 Overlaps
 test whether two ComplexBox objects overlap
 Contains
 test whether a ComplexBox object contains another

 Calling Sequence IsZero( b ) HasZero( b ) IsOne( b ) IsReal( b ) IsExact( b ) IsInteger( b ) HasInteger( b ) IsFinite( b ) IsInfinity( b ) IsUndefined( b ) Equal( b1, b2 ) Eq( b1, b2 ) NotEq( b1, b2 ) Overlaps( b1, b2 ) Contains( b1, b2 )

Parameters

 b - ComplexBox object b1 - ComplexBox object b2 - ComplexBox object precopt - (optional) equation of the form precision = n, where n is a positive integer

Description

 • Each ComplexBox 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 ComplexBox object) or binary (for comparing two ComplexBox objects).
 • The following table describes briefly the defined unary predicates.

 Predicate Description IsZero returns true if the ComplexBox represents an exact zero (centers and radii are both $0$) HasZero returns true if the ComplexBox contains zero IsOne returns true if the ComplexBox represents $1$ exactly IsReal returns true if the ComplexBox represents a real number (i.e, imaginary part is an exact zero) IsExact returns true if the ComplexBox has zero radii IsInteger returns true if the ComplexBox has zero radii and integer center HasInteger returns true if the ComplexBox contains an integer IsFinite returns true if the ComplexBox has finite real and imaginary parts IsInfinity returns true if the ComplexBox is a complex infinity IsUndefined returns true if the ComplexBox is an undefined

 • The binary predicates (comparing two ComplexBox objects) that are defined are described briefly in the following table.

 Predicate Description Equal returns true if its arguments are identical as boxes Eq returns true if its arguments are "mathematically equal" NotEq returns true if its arguments are not "mathematically equal" Overlaps returns true if its arguments have non-empty intersection Contains returns true if the first argument is entirely contained in the second

 • Use the 'precision' = n option to control the precision used in these methods. For more details on precision, see BoxPrecision.

Examples

 > $\mathrm{IsZero}\left(\mathrm{ComplexBox}\left(0\right)\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{IsZero}\left(\mathrm{ComplexBox}\left(0.0\right)\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{IsZero}\left(\mathrm{ComplexBox}\left(0.0I\right)\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{IsZero}\left(\mathrm{ComplexBox}\left(1.{10}^{-40}\right)\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{IsZero}\left(\mathrm{ComplexBox}\left(1.{10}^{-40}I\right)\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{HasZero}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(2.3,1.{10}^{-20}\right),\mathrm{RealBox}\left(0\right)\right)\right)$
 ${\mathrm{false}}$ (6)
 > $\mathrm{HasZero}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(0.001,0.002\right),\mathrm{RealBox}\left(0\right)\right)\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{IsOne}\left(\mathrm{ComplexBox}\left(1\right)\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{IsOne}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(1,1.{10}^{-30}\right)\right)\right)$
 ${\mathrm{false}}$ (9)
 > $\mathrm{IsOne}\left(\mathrm{ComplexBox}\left(1.0+0.0I\right)\right)$
 ${\mathrm{true}}$ (10)
 > $\mathrm{IsOne}\left(\mathrm{ComplexBox}\left(1.0-0.0I\right)\right)$
 ${\mathrm{true}}$ (11)
 > $\mathrm{IsReal}\left(\mathrm{ComplexBox}\left(2.3\right)\right)$
 ${\mathrm{true}}$ (12)
 > $\mathrm{IsReal}\left(\mathrm{ComplexBox}\left(2.3+1.{10}^{-40}I\right)\right)$
 ${\mathrm{false}}$ (13)
 > $\mathrm{IsReal}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(2.3,1.{10}^{-20}\right)\right)\right)$
 ${\mathrm{true}}$ (14)
 > $\mathrm{IsReal}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(2.3,1.{10}^{-20}\right),\mathrm{RealBox}\left(0\right)\right)\right)$
 ${\mathrm{true}}$ (15)
 > $\mathrm{IsReal}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(2.3,1.{10}^{-20}\right),\mathrm{RealBox}\left(0,1.{10}^{-30}\right)\right)\right)$
 ${\mathrm{false}}$ (16)
 > $\mathrm{IsExact}\left(\mathrm{ComplexBox}\left(2.3+5.1I\right)\right)$
 ${\mathrm{false}}$ (17)
 > $\mathrm{IsExact}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(2.3,1.{10}^{-40}\right),\mathrm{RealBox}\left(5.1\right)\right)\right)$
 ${\mathrm{false}}$ (18)
 > $\mathrm{IsExact}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(2.3\right),\mathrm{RealBox}\left(5.1,1.{10}^{-30}\right)\right)\right)$
 ${\mathrm{false}}$ (19)
 > $\mathrm{IsExact}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(2.3,1.{10}^{-20}\right),\mathrm{RealBox}\left(5.1,1.{10}^{-30}\right)\right)\right)$
 ${\mathrm{false}}$ (20)
 > $\mathrm{IsExact}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(2.3\right),\mathrm{RealBox}\left(5.1\right)\right)\right)$
 ${\mathrm{false}}$ (21)
 > $\mathrm{IsInteger}\left(\mathrm{ComplexBox}\left(4\right)\right)$
 ${\mathrm{true}}$ (22)
 > $\mathrm{IsInteger}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(4\right)\right)\right)$
 ${\mathrm{true}}$ (23)

This returns false because it is not exact:

 > $\mathrm{IsInteger}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(4,1.{10}^{-20}\right)\right)\right)$
 ${\mathrm{false}}$ (24)
 > $\mathrm{IsInteger}\left(\mathrm{ComplexBox}\left(4I\right)\right)$
 ${\mathrm{false}}$ (25)
 > $\mathrm{HasInteger}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(1.001,0.002\right),\mathrm{RealBox}\left(0\right)\right)\right)$
 ${\mathrm{true}}$ (26)
 > $\mathrm{HasInteger}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(0.5\right),\mathrm{RealBox}\left(1.001,0.002\right)\right)\right)$
 ${\mathrm{false}}$ (27)
 > $\mathrm{IsFinite}\left(\mathrm{ComplexBox}\left(2+3I\right)\right)$
 ${\mathrm{true}}$ (28)
 > $\mathrm{IsFinite}\left(\mathrm{ComplexBox}\left(2+\mathrm{∞}I\right)\right)$
 ${\mathrm{false}}$ (29)
 > $\mathrm{IsFinite}\left(\mathrm{ComplexBox}\left(-\mathrm{Float}\left(\mathrm{∞}\right)-3I\right)\right)$
 ${\mathrm{false}}$ (30)
 > $\mathrm{IsUndefined}\left(\mathrm{ComplexBox}\left(\mathrm{Float}\left(\mathrm{undefined}\right)-I\mathrm{Float}\left(\mathrm{undefined}\right)\right)\right)$
 ${\mathrm{true}}$ (31)
 > $\mathrm{IsUndefined}\left(\mathrm{ComplexBox}\left(\mathrm{Float}\left(\mathrm{∞}\right)-I\mathrm{Float}\left(\mathrm{undefined}\right)\right)\right)$
 ${\mathrm{false}}$ (32)
 > $\mathrm{IsUndefined}\left(\mathrm{ComplexBox}\left(\mathrm{Float}\left(\mathrm{undefined}\right)+I\mathrm{Float}\left(\mathrm{∞}\right)\right)\right)$
 ${\mathrm{false}}$ (33)
 > $\mathrm{IsUndefined}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(0,\mathrm{∞}\right),\mathrm{RealBox}\left(2.3\right)\right)\right)$
 ${\mathrm{false}}$ (34)
 > $\mathrm{IsInfinity}\left(\mathrm{ComplexBox}\left(\mathrm{Float}\left(\mathrm{∞}\right)-3I\right)\right)$
 ${\mathrm{false}}$ (35)
 > $\mathrm{IsInfinity}\left(\mathrm{ComplexBox}\left(-\mathrm{Float}\left(\mathrm{∞}\right)+3.2I\right)\right)$
 ${\mathrm{false}}$ (36)
 > $\mathrm{IsInfinity}\left(\mathrm{ComplexBox}\left(\mathrm{Float}\left(\mathrm{∞}\right)+I\mathrm{Float}\left(\mathrm{∞}\right)\right)\right)$
 ${\mathrm{true}}$ (37)
 > $\mathrm{IsInfinity}\left(\mathrm{ComplexBox}\left(\mathrm{Float}\left(\mathrm{∞}\right)-I\mathrm{Float}\left(\mathrm{∞}\right)\right)\right)$
 ${\mathrm{true}}$ (38)
 > $\mathrm{IsInfinity}\left(\mathrm{ComplexBox}\left(-\mathrm{Float}\left(\mathrm{∞}\right)+I\mathrm{Float}\left(\mathrm{∞}\right)\right)\right)$
 ${\mathrm{true}}$ (39)
 > $\mathrm{IsInfinity}\left(\mathrm{ComplexBox}\left(-\mathrm{Float}\left(\mathrm{∞}\right)-I\mathrm{Float}\left(\mathrm{∞}\right)\right)\right)$
 ${\mathrm{true}}$ (40)
 > $\mathrm{IsInfinity}\left(\mathrm{ComplexBox}\left(\mathrm{RealBox}\left(0,\mathrm{∞}\right),\mathrm{RealBox}\left(0,\mathrm{∞}\right)\right)\right)$
 ${\mathrm{false}}$ (41)

Compatibility

 • The ComplexBox[Predicates], ComplexBox:-IsZero, ComplexBox:-HasZero, ComplexBox:-IsOne, ComplexBox:-IsReal, ComplexBox:-IsExact, ComplexBox:-IsInteger, ComplexBox:-HasInteger, ComplexBox:-IsFinite, ComplexBox:-IsInfinity, ComplexBox:-IsUndefined, ComplexBox:-Equal, ComplexBox:-Eq, ComplexBox:-NotEq, ComplexBox:-Overlaps and ComplexBox:-Contains commands were introduced in Maple 2022.