NonNegative¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
NonNegative[x]
gives True if x is a real number that is positive or zero, and False
Notes
if x is a manifestly negative real number or a non-real complex number. For non-numeric x the expression is left unevaluated. NonNegative is Listable, so it threads over lists element by element.Examples (3)¶
Every input below was run against the current Mathilda build and its output recorded.
Basic examples (3)¶
In[1]:= NonNegative[{1.6, 3/4, Pi, 0, -5, 1 + I, Sin[10^5]}]
Out[1]= {True, True, True, True, False, False, True}
In[2]:= NonNegative[{x, Sin[y]}]
Out[2]= {NonNegative[x], NonNegative[Sin[y]]}
In[3]:= NonNegative[Pi - 3]
Out[3]= True
Implementation notes¶
Attributes: Listable, Protected.
References¶
See also: NumericQ
- Source:
src/info.c - Specification:
docs/spec/builtins/expression-information.md - Tests:
tests/test_ndarray_functions.c - Tests:
tests/test_nonnegative.c - Tests:
tests/test_packed_list.c