hasNumericValue

hasNumericValue(x)

Try it yourself:


Test whether a value is numeric

hasNumericValue(x) checks whether x has a usable numeric value. It is useful for validating mixed inputs before arithmetic, parsing user entries, or choosing a safe branch in a calculation.

Validation workflow

Test values before passing them to sum, mean, or a matrix operation. Compare isNumeric, which answers a related type-oriented question, and isFinite when infinite values must also be rejected.

Important distinction

A value that can be treated numerically is not necessarily valid for every domain: a negative number can have numeric value but fail sqrt in real-only use. Validate required ranges with functions such as isPositive. Do not use this test as a replacement for checking units, shape, or missing-data policy.

All functions