Previous Page Next Page Contents

Type::Negative -- a type and a property representing negative numbers

Introduction

Type::Negative represents negative numbers. Type::Negative is a property, too, which can be used in an assume call.

Call(s)

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

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::Real, Type::Property

Details

Example 1

The following numbers are of type Type::Negative:

>> testtype(-2, Type::Negative),
   testtype(-3/4, Type::Negative),
   testtype(-0.123, Type::Negative),
   testtype(-1, Type::Negative),
   testtype(-1.02, Type::Negative)
                       TRUE, TRUE, TRUE, TRUE, TRUE

The following expressions are exact representations of negative numbers, but syntactically they are not of Type::Negative:

>> testtype(-exp(1), Type::Negative),
   testtype(-PI^2 - 5, Type::Negative),
   testtype(-sin(2), Type::Negative)
                            FALSE, FALSE, FALSE

Example 2

Assume an identifier is negative:

>> assume(x, Type::Negative):
   is(x, Type::Negative)
                                   TRUE

This is equal to:

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

Also negative numbers are real:

>> assume(x, Type::Negative):
   is(x, Type::Real)
                                   TRUE

However, real numbers can be negative or not:

>> assume(x, Type::Real):
   is(x, Type::Negative)
                                  UNKNOWN
>> delete x:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000