Type::NonZero

Type and property representing "unequal to zero"

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

testtype(obj, Type::NonZero)
assume(x, Type::NonZero)
is(ex, Type::NonZero)

Description

Type::NonZero is a type of objects unequal to zero. Type::NonZero is a property, too, which can be used in an assume call.

The call 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.

The call 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).

This type represents a property that can be used in assume and is.

The call assume(x <> 0) has the same meaning as assume(x, Type::NonZero).

Examples

Example 1

Usage of Type::NonZero whith testtype:

testtype(1.0, Type::NonZero)

Since iszero(x) returns FALSE, the following call returns TRUE:

testtype(x, Type::NonZero)

Example 2

Usage of Type::NonZero whith assume and is:

is(x, Type::NonZero)

Assumption: x is Type::NonZero:

assume(x, Type::NonZero):
is(x, Type::NonZero)

The same again:

assume(x <> 0):
is(x <> 0)

The difference between testtype and is:

delete x:
is(x, Type::NonZero), testtype(x, Type::NonZero)

x could be zero:

assume(x >= 0):
is(x, Type::NonZero), testtype(x, Type::NonZero)

delete x:

Parameters

obj

Any MuPAD® object

x

An identifier or a mathematical expression containing identifiers

ex

An arithmetical expression

Return Values

See testtype, assume and is

See Also

MuPAD Functions

Was this topic helpful?