is-negative ![Build Status](https://camo.githubusercontent.com/c949c3a9f449be34aae4837e1a2dc58812c58ffe4ca93843709f85ba51ec626b/68747470733a2f2f7472617669732d63692e6f72672f6b657676612f69732d6e656761746976652e7376673f6272616e63683d6d6173746572)
Check if something is a negative number
Install
$ npm install --save is-negative
Usage
const isNegative = require('is-negative');
isNegative(-1);
//=> true
isNegative(1);
//=> false
isNegative(0);
//=> false
isNegative('-1');
//=> false
isNegative(Number(-1))
//=> true
Note: This module doesn't consider -0
to be a negative number. If you want to detect -0
, use the negative-zero
module.
Related
- is-positive - Check if something is a positive number
License
MIT © Kevin Martensson