WOLFRAM

gives True if expr is a valid NumericArray object, and False otherwise.

NumericArrayQ[expr, tpatt]

requires additionally that NumericArrayType[expr] match the pattern tpatt.

NumericArrayQ[expr,tpatt,dpatt]

requires additionally that ArrayDepth[expr] match the pattern dpatt.

Examples

open allclose all

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

A valid NumericArray object:

Out[1]=1

An expression with head NumericArray that is not a valid byte array object:

Out[1]=1

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

Include a test for the type:

Out[2]=2

Check to see if the type is a real type:

Out[1]=1

Check to see if the type is either a machine integer or real type:

Out[1]=1

Include a test for the array depth:

Out[1]=1

Allow depth up to 2:

Out[1]=1

Require depth greater than or equal to 2:

Out[1]=1

Constrain both the depth and the number type:

Out[1]=1

Possible Issues  (1)Common pitfalls and unexpected behavior

The default conversion method will fail when the input array contains numbers that are out of range for the specified type.

Try to store in an "Integer8" numeric array:

Out[3]=3

Use the "ClipAndCoerce" method to automatically clip to the smallest "Integer8":

Out[4]=4
Wolfram Research (2019), NumericArrayQ, Wolfram Language function, https://reference.wolfram.com/language/ref/NumericArrayQ.html.
Wolfram Research (2019), NumericArrayQ, Wolfram Language function, https://reference.wolfram.com/language/ref/NumericArrayQ.html.

Text

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

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

CMS

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

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

APA

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

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

BibTeX

@misc{reference.wolfram_2025_numericarrayq, author="Wolfram Research", title="{NumericArrayQ}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/NumericArrayQ.html}", note=[Accessed: 08-July-2025 ]}

@misc{reference.wolfram_2025_numericarrayq, author="Wolfram Research", title="{NumericArrayQ}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/NumericArrayQ.html}", note=[Accessed: 08-July-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_numericarrayq, organization={Wolfram Research}, title={NumericArrayQ}, year={2019}, url={https://reference.wolfram.com/language/ref/NumericArrayQ.html}, note=[Accessed: 08-July-2025 ]}

@online{reference.wolfram_2025_numericarrayq, organization={Wolfram Research}, title={NumericArrayQ}, year={2019}, url={https://reference.wolfram.com/language/ref/NumericArrayQ.html}, note=[Accessed: 08-July-2025 ]}