Rationals
represents the domain of rational numbers, as in x∈Rationals.
Details
- x∈Rationals evaluates immediately if x is a numeric quantity.
- Simplify[expr∈Rationals,assum] can be used to try to determine whether an expression corresponds to a rational number under the given assumptions.
- (x1x2…)∈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 . This typeset form can be input using rats.
Examples
open allclose allBasic Examples (3)
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:
Text
Wolfram Research (1999), Rationals, Wolfram Language function, https://reference.wolfram.com/language/ref/Rationals.html (updated 2017).
CMS
Wolfram Language. 1999. "Rationals." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/Rationals.html.
APA
Wolfram Language. (1999). Rationals. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Rationals.html