up previous next
IsRational

check if a RINGELEM is rational

Syntax
IsRational(ref n: RAT, f: RINGELEM): BOOL

Description
This function tests whether the argument f is rational and convert it into a RAT . To convert f straight away use AsRAT(f) .

Example
/**/ use R ::= QQ[x];
/**/ f := x-x-3;  f;  type(f);
-3
RINGELEM
/**/ IsRational(ref a, x-x-3);
true
/**/ a;  type(a);
-3
RAT

See Also