represents the domain of non-negative rational numbers, as in x∈NonNegativeRationals.
NonNegativeRationals
represents the domain of non-negative rational numbers, as in x∈NonNegativeRationals.
Details
- x∈NonNegativeRationals evaluates immediately if x is a numeric quantity.
- Simplify[expr∈NonNegativeRationals,assum] can be used to try to determine whether an expression corresponds to a non-negative rational number under the given assumptions.
- (x1|x2|…)∈NonNegativeRationals and {x1,x2,…}∈NonNegativeRationals test whether all xi are non-negative rational numbers.
- The domain of non-negative integers is taken to be a subset of the domain of non-negative rationals.
- NonNegativeRationals is output in StandardForm or TraditionalForm as
. This typeset form can be input using
nnrats
.
Examples
open all close allBasic Examples (3)
2/3 is a non-negative rational number:
Element[2 / 3, NonNegativeRationals]A sum of non-negative rational numbers is a non-negative rational number:
Simplify[x + y∈NonNegativeRationals, (x | y)∈NonNegativeRationals]Find non-negative rational solutions of an equation:
Reduce[(2x ^ 2 - 1)(4x ^ 2 - 1) == 0, x, NonNegativeRationals]Scope (5)
Test domain membership of a numeric expression:
Element[21 / 32, NonNegativeRationals]Element[0, NonNegativeRationals]Element[Pi, NonNegativeRationals]Make domain membership assumptions:
Refine[x^2 + 2 x y + (y^3/3)∈NonNegativeRationals, (x | y)∈NonNegativeRationals]Specify the default domain over which Reduce should work:
Reduce[(x ^ 2 - 4 / 9)(x ^ 3 - 2) == 0, x, NonNegativeRationals]Test whether several numbers are non-negative rationals:
(x | y | 1 / 2)∈NonNegativeRationalsIf any number is explicitly not a non-negative rational, the result is False:
{x, y, -1 / 2}∈NonNegativeRationalsTraditionalForm formatting:
NonNegativeRationals//TraditionalFormProperties & Relations (4)
Membership in NonNegativeRationals is equivalent to membership in Rationals and non-negativity:
x∈NonNegativeRationalsNonNegativeRationals contains NonNegativeIntegers:
Refine[x∈NonNegativeRationals, x∈NonNegativeIntegers]NonNegativeRationals is contained in NonNegativeReals, Algebraics and Complexes:
Refine[x∈NonNegativeReals, x∈NonNegativeRationals]Refine[x∈Algebraics, x∈NonNegativeRationals]Refine[x∈ℂ, x∈NonNegativeRationals]NonNegativeRationals is disjoint from NegativeRationals:
Reduce[x∈NegativeRationals, x, NonNegativeRationals]NonNegativeRationals intersects NonPositiveRationals:
Reduce[x∈NonPositiveRationals, x, NonNegativeRationals]Tech Notes
Related Guides
History
Text
Wolfram Research (2019), NonNegativeRationals, Wolfram Language function, https://reference.wolfram.com/language/ref/NonNegativeRationals.html.
CMS
Wolfram Language. 2019. "NonNegativeRationals." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NonNegativeRationals.html.
APA
Wolfram Language. (2019). NonNegativeRationals. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NonNegativeRationals.html
BibTeX
@misc{reference.wolfram_2026_nonnegativerationals, author="Wolfram Research", title="{NonNegativeRationals}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/NonNegativeRationals.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_nonnegativerationals, organization={Wolfram Research}, title={NonNegativeRationals}, year={2019}, url={https://reference.wolfram.com/language/ref/NonNegativeRationals.html}, note=[Accessed: 13-June-2026]}