[ Type Testing | Reference Manual | Alphabetic Index ]
rational(?Rational)
Succeeds if Rational is a rational number.
- Rational
- Prolog term.
Description
Used to test whether Rational is a rational number.
Modes and Determinism
Fail Conditions
Fails if Rational is not a rational number
Examples
Success:
rational(1_3).
set_flag(prefer_rationals, on), X is 1/3, rational(X).
Fail:
rational(1).
rational(1.0).
rational('1.0').
rational(a).
rational(X).
See Also
atomic / 1, integer / 1, number / 1, float / 1, real / 1, breal / 1