WOLFRAM

gives True if expr is a real-valued numeric quantity, and False otherwise.

Details

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

RealValuedNumericQ tests whether an object is a real-valued numeric quantity:

Out[1]=1

RealValuedNumericQ[expr] gives True whenever N[expr] yields a number with head Real:

Out[2]=2
Out[3]=3

A general symbolic expression is not a real-valued numeric quantity:

Out[1]=1

Scope  (9)Survey of the scope of standard use cases

Integers and rationals are real-valued numeric quantities:

Out[1]=1
Out[2]=2

Approximate reals are real-valued numeric quantities:

Out[1]=1
Out[2]=2

RealValuedNumericQ gives True for real-valued mathematical constants:

Out[1]=1
Out[2]=2

RealValuedNumericQ gives True for exact expressions representing real values:

Out[1]=1
Out[2]=2

Complex numbers are not real-valued quantities:

Out[1]=1

Exact complex quantities whose imaginary part is zero are real valued:

Out[1]=1

The number has a real part of and an imaginary part of :

Out[2]=2

Approximate complex numbers are not considered real valued even if their imaginary part equals zero:

Out[1]=1
Out[2]=2
Out[3]=3

RealValuedNumericQ[Infinity] gives False:

Out[1]=1

RealValuedNumericQ[Overflow[]] and RealValuedNumericQ[Underflow[]] give True:

Out[1]=1
Out[2]=2

They are both treated as Real:

Out[3]=3

Properties & Relations  (3)Properties of the function, and connections to other functions

If Head[N[x]] is Real, then RealValuedNumericQ[x] is True:

It is possible for RealValuedNumericQ[x] to be True and for N[x] to have head Complex:

Out[1]=1

This indicates that x has an imaginary part that is exactly zero:

Out[2]=2

If RealValuedNumberQ[x] is True, then RealValuedNumericQ[x] is also True:

Possible Issues  (2)Common pitfalls and unexpected behavior

Exact quantities whose imaginary parts vanish may not be identified by RealValuedNumericQ:

Out[2]=2

If detecting such numbers is important, simplify the expression before testing it:

Out[3]=3

An exact number and its numerical approximation may give different results for RealValuedNumericQ:

Out[1]=1

It is not possible to determine if the number is real, as its imaginary part is only approximately zero:

Out[2]=2
Wolfram Research (2023), RealValuedNumericQ, Wolfram Language function, https://reference.wolfram.com/language/ref/RealValuedNumericQ.html.
Wolfram Research (2023), RealValuedNumericQ, Wolfram Language function, https://reference.wolfram.com/language/ref/RealValuedNumericQ.html.

Text

Wolfram Research (2023), RealValuedNumericQ, Wolfram Language function, https://reference.wolfram.com/language/ref/RealValuedNumericQ.html.

Wolfram Research (2023), RealValuedNumericQ, Wolfram Language function, https://reference.wolfram.com/language/ref/RealValuedNumericQ.html.

CMS

Wolfram Language. 2023. "RealValuedNumericQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RealValuedNumericQ.html.

Wolfram Language. 2023. "RealValuedNumericQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RealValuedNumericQ.html.

APA

Wolfram Language. (2023). RealValuedNumericQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RealValuedNumericQ.html

Wolfram Language. (2023). RealValuedNumericQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RealValuedNumericQ.html

BibTeX

@misc{reference.wolfram_2025_realvaluednumericq, author="Wolfram Research", title="{RealValuedNumericQ}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/RealValuedNumericQ.html}", note=[Accessed: 19-May-2025 ]}

@misc{reference.wolfram_2025_realvaluednumericq, author="Wolfram Research", title="{RealValuedNumericQ}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/RealValuedNumericQ.html}", note=[Accessed: 19-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_realvaluednumericq, organization={Wolfram Research}, title={RealValuedNumericQ}, year={2023}, url={https://reference.wolfram.com/language/ref/RealValuedNumericQ.html}, note=[Accessed: 19-May-2025 ]}

@online{reference.wolfram_2025_realvaluednumericq, organization={Wolfram Research}, title={RealValuedNumericQ}, year={2023}, url={https://reference.wolfram.com/language/ref/RealValuedNumericQ.html}, note=[Accessed: 19-May-2025 ]}