represents the domain of rational numbers, as in xRationals.


  • xRationals evaluates immediately if x is a numeric quantity.
  • Simplify[exprRationals,assum] can be used to try to determine whether an expression corresponds to a rational number under the given assumptions.
  • (x1|x2|)Rationals and {x1,x2,}Rationals test whether all xi are rational numbers.
  • The domain of integers is taken to be a subset of the domain of rationals.
  • Rationals is output in StandardForm or TraditionalForm as TemplateBox[{}, Rationals]. This typeset form can be input using rats.


open allclose all

Basic Examples  (3)

2/3 is a rational number:

A sum of rational numbers is a rational number:

Find rational solutions of an equation:

Scope  (5)

Test domain membership of a numeric expression:

Make domain membership assumptions:

Specify the default domain over which Reduce should work:

Test whether several numbers are rational:

If any number is explicitly irrational, the result is False:

TraditionalForm formatting:

Properties & Relations  (2)

Rationals contains Integers and Primes:

Rationals is contained in Complexes, Reals, and Algebraics:

Introduced in 1999
Updated in 2017