Type::NonZero
-- a type and a
property representing ``unequal to zero''Type::NonZero
is a type of objects unequal to zero.
Type::NonZero
is a property, too, which can be used in an
assume
call.
testtype(obj,
Type::NonZero)
assume(x,
Type::NonZero)
is(ex,
Type::NonZero)
obj |
- | any MuPAD object |
x |
- | an identifier or one of the expressions Re(u) or Im(u) with an identifier
u |
ex |
- | an arithmetical expression |
testtype
, is
, assume
, Type::Zero
testtype(obj,
Type::NonZero)
checks, whether obj
is not zero and returns
TRUE
, if it holds,
otherwise FALSE
.testtype
only
performs a syntactical test and uses the function iszero
to determine, whether the
object is not zero. This implies that identifiers without a value, for
example, are considered as being different from zero, see
example 1.assume(x,
Type::NonZero) marks the identifier x
as a complex number
unequal to zero.
The call is(ex,
Type::NonZero) derives, whether the expression ex
is a
complex number unequal to zero (or this property can be derived).
assume
and is
.assume(x <>
0)
has the same meaning as assume(x,
Type::NonZero).Usage of Type::NonZero
whith testtype
:
>> testtype(1.0, Type::NonZero)
TRUE
Since iszero(x)
returns FALSE
, the following call returns
TRUE
:
>> testtype(x, Type::NonZero)
TRUE
Usage of Type::NonZero
whith assume
and is
:
>> is(x, Type::NonZero)
UNKNOWN
Assumption: x
is
Type::NonZero
:
>> assume(x, Type::NonZero): is(x, Type::NonZero)
TRUE
The same again:
>> assume(x <> 0): is(x <> 0)
TRUE
The difference between testtype
and is
:
>> delete x: is(x, Type::NonZero), testtype(x, Type::NonZero)
UNKNOWN, TRUE
x
could be zero:
>> assume(x >= 0): is(x, Type::NonZero), testtype(x, Type::NonZero)
UNKNOWN, TRUE
>> delete x: