This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Type and property representing negative rational numbers

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


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


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

The call testtype(obj, Type::NegRat) checks, whether obj is a negative 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::NegRat) marks the identifier x as a negative rational number.

The call is(ex, Type::NegRat) derives, whether the expression ex is a negative 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::NegRat:

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

Example 2

Assume an identifier is negative rational:

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

Also negative rational numbers are rational:

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

However, rational numbers can be negative rational or not:

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

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?