QuantityQ

QuantityQ[expr]

gives True if expr is a Quantity with valid arguments, and False otherwise.

Details

  • QuantityQ[expr] returns False unless expr is a Quantity expression with valid arguments (i.e. has a canonical unit).

Examples

open allclose all

Basic Examples  (1)

QuantityQ tests whether an object is a Quantity with valid arguments:

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:

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

Text

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

BibTeX

@misc{reference.wolfram_2020_quantityq, author="Wolfram Research", title="{QuantityQ}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/QuantityQ.html}", note=[Accessed: 10-April-2021 ]}

BibLaTeX

@online{reference.wolfram_2020_quantityq, organization={Wolfram Research}, title={QuantityQ}, year={2012}, url={https://reference.wolfram.com/language/ref/QuantityQ.html}, note=[Accessed: 10-April-2021 ]}

CMS

Wolfram Language. 2012. "QuantityQ." Wolfram Language & System Documentation Center. Wolfram Research. 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