Previous Page Contents

Type::Zero -- a type and a property representing zero

Introduction

testtype(obj, Type::Zero) is equivalent to iszero(obj). Type::Zero is a property, too, which can be used in an assume call.

Call(s)

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

Parameters

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

Returns

see testtype, assume and is

Related Functions

testtype, is, assume, Type::NonZero

Details

Example 1

testtype determines the syntactical equality to zero:

>> testtype(0.0, Type::Zero)
                                   TRUE
>> testtype(x, Type::Zero)
                                   FALSE

Example 2

Type::Zero can be used within assume and is:

>> is(x, Type::Zero)
                                  UNKNOWN

Assumption that x is zero:

>> assume(x, Type::Zero):
   is(x^2, Type::Zero)
                                   TRUE

The next example shows the difference between testtype and is:

>> is(x, Type::Zero), testtype(x, Type::Zero)
                                TRUE, FALSE

Now the property of x is removed:

>> delete x:
   is(x, Type::Zero), testtype(x, Type::Zero)
                              UNKNOWN, FALSE

A positive number cannot be zero:

>> assume(x > 0):
   is(x, Type::Zero), testtype(x, Type::Zero)
                               FALSE, FALSE

But in the next example x could be zero:

>> assume(x >= 0):
   is(x, Type::Zero), testtype(x, Type::Zero)
                              UNKNOWN, FALSE
>> delete x:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000