Previous Page Next Page Contents

Type::Real -- a type and a property representing real numbers

Introduction

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

Call(s)

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

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::Property

Details

Example 1

The following numbers are of type Type::Real:

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

The following expressions are exact representations of real numbers, but syntactically they are not of Type::Real:

>> testtype(exp(1), Type::Real),
   testtype(PI^2 + 5, Type::Real),
   testtype(sin(2), Type::Real)
                            FALSE, FALSE, FALSE

The function is performs a semantical, mathematically more useful check:

>> is(exp(1), Type::Real),
   is(PI^2 + 5, Type::Real),
   is(sin(2), Type::Real)
                             TRUE, TRUE, TRUE

Example 2

Integers are real numbers:

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

But real numbers can be integer or not:

>> assume(x, Type::Real):
   is(x, Type::Integer)
                                  UNKNOWN

The sine of a real number is a real number in the interval [-1,1]:

>> getprop(sin(x))
                           [-1, 1] of Type::Real
>> delete x:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000