<< mustBeNonmissing Validators mustBeNonpositive >>

mustBeNonnegative


Checks that value is nonnegative or raise an error.


Syntax


mustBeNonnegative(var)
mustBeNonnegative(var, argPosition)
C++: void mustBeNonnegative(const ArrayOfVector& args, int argPosition)

Input argument


var

a variable: all supported types and classes that implement isnumeric, islogical, all, isreal, and ge methods.

argPosition

a positive integer value: Position of input argument.

Description


mustBeNonnegative checks that value is nonnegative or raise an error.

Example


mustBeNonnegative(1)
mustBeNonnegative(-1)

See also


mustBePositive.

History


Version Description
1.0.0 initial version

Author


Allan CORNET

<< mustBeNonmissing Validators mustBeNonpositive >>