Type and property representing positive rational numbers

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


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


Type::PosRat represents positive rational numbers. Type::PosRat is a property, too, which can be used in an assume call.

The call testtype(obj, Type::PosRat) checks, whether obj is a positive rational number and returns TRUE, if it holds, otherwise FALSE.

testtype only performs a syntactical test identifying MuPAD® objects of type DOM_INT and DOM_RAT and checks, if bool(obj > 0) holds.

The call assume(x, Type::PosRat) marks the identifier x as a positive rational number.

The call is(ex, Type::PosRat) derives, whether the expression ex is a positive rational number (or this property can be derived).

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


Example 1

The following numbers are of type Type::PosRat:

testtype(2, Type::PosRat),
testtype(3/4, Type::PosRat),
testtype(55/111, Type::PosRat),
testtype(1, Type::PosRat),
testtype(111/111111, Type::PosRat)

Example 2

Assume an identifier is positive rational:

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

Also positive rational numbers are rational:

assume(x, Type::PosRat):
is(x, Type::Rational)

However, rational numbers can be positive rational or not:

assume(x, Type::Rational):
is(x, Type::PosRat)

delete x:



Any MuPAD object


An identifier or a mathematical expression containing identifiers


An arithmetical expression

Return Values

See testtype, assume and is

See Also

MuPAD Functions

Was this topic helpful?