[Next] [Contents]

Type::Intersection -- a type representing the intersection of several types

Introduction

Type::Intersection(type1, type2...) represents all objects having all of the types type1, type2...

Call(s)


testtype(obj, Type::Intersection(obj_types...))

Parameters

obj- any MuPAD object
obj_types- a sequence of types; a type can be an object of the library Type or one of the possible return values of domtype and type

Returns

see testtype

Related Functions

testtype

Details

Example 1

Check, whether the given object is a positive and odd integer:

>> testtype(1, Type::Intersection(Type::PosInt, Type::Odd))
                                   TRUE

2 however, is not a positive and a odd number:

>> testtype(2, Type::Intersection(Type::PosInt, Type::Odd))
                                   FALSE

Example 2

testtype is used to select positive and odd integers:

>> SET:= {-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2, 3}:
   select(SET, testtype, Type::Intersection(Type::PosInt, Type::Odd))
                                  {1, 3}
>> delete SET:

Changes

[Next] [Contents]


MuPAD Combinat, an open source algebraic combinatorics package