Function isNegative

Test whether a value is negative: smaller than zero. The function supports types number, BigNumber, Fraction, and Unit.

The function is evaluated element-wise in case of Array or Matrix input.




Parameter Type Description
x number | BigNumber | Fraction | Unit | Array | Matrix Value to be tested


Type Description
boolean Returns true when x is larger than zero. Throws an error in case of an unknown data type.


isNegative(3);                     // returns false
isNegative(-2);                    // returns true
isNegative(0);                     // returns false
isNegative(-0);                    // returns false
isNegative(bignumber(2));     // returns false
isNegative(fraction(-2, 5));  // returns true
isNegative('-2');                  // returns true
isNegative([2, 0, -3]');           // returns [false, false, true]

See also

isNumeric, isPositive, isZero, isInteger