

QuantityQ

Details

- QuantityQ[expr] returns False unless expr is a Quantity expression with valid arguments (i.e. has a canonical unit).
- QuantityQ[expr,dims] returns True if expr is a valid Quantity and is compatible with dims.
- Dimensional specification dims may be a list of unit dimensions, a QuantityVariable, a Quantity or a string representing a quantity variable or unit dimension.
Examples
open all close allBasic Examples (2)
Scope (3)
Applications (1)
QuantityQ can be used in pattern tests for functions:

Properties & Relations (3)
QuantityQ returns False for any expression whose head is not Quantity:
In particular, QuantityArray, QuantityVariable, and QuantityDistribution are not QuantityQ objects:
QuantityQ returns False for Quantity expressions with invalid arguments:
QuantityQ returns True only for Quantity expressions with valid arguments:
See Also
Tech Notes
Related Guides
Related Workflows
- Calculate with Units
Text
Wolfram Research (2012), QuantityQ, Wolfram Language function, https://reference.wolfram.com/language/ref/QuantityQ.html (updated 2024).
CMS
Wolfram Language. 2012. "QuantityQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/QuantityQ.html.
APA
Wolfram Language. (2012). QuantityQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/QuantityQ.html
BibTeX
@misc{reference.wolfram_2025_quantityq, author="Wolfram Research", title="{QuantityQ}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/QuantityQ.html}", note=[Accessed: 11-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_quantityq, organization={Wolfram Research}, title={QuantityQ}, year={2024}, url={https://reference.wolfram.com/language/ref/QuantityQ.html}, note=[Accessed: 11-August-2025]}