A collection of useful helper functions for numbers manipulation in Javascript
npm install numeryNumery is a collection of useful helper functions for numbers manipulation in Javascript
```
yarn add numery
`js`
const { isValidNumber } = require('numery')
- For Numbers in General
- isValidNumber
- isEvenNumber
- isOddNumber
- isFiniteNumber
- isFinitePositiveNumber
- isStrictFinitePositiveNumber
- isFiniteNegativeNumber
- isNumberMultipleOf
- For Integers
- isInterger
- isPositiveInteger
- isStrictPositiveInteger
- isNegativeInteger
- Signature: isValidNumber(x: Any) => boolean[-Infinity, Infinity]
- Verify that the given argument data type is in fact a valid number.
- A valid number is any number between , including the infinities, but not NaN.isFiniteNumber(x)
- To exclude infinities, use insteadtrue
- Return if a valid number. false otherwise.
- Signature: isEvenNumber(x: Any) => booleantrue
- Verify if the argument is an even number.
- Return if even. false otherwise.
- Signature: isOddNumber(x: Any) => booleantrue
- Verify if the argument is an odd number.
- Return if odd. false otherwise.
- Signature: isFiniteNumber(x: Any) => booleantrue
- Verify that the argument is in fact a finite number.
- A finite number is a valid number that is not an infinity (+ or -).
- Return if a finite number. false otherwise.
- Signature: isFinitePositiveNumber(x: Any) => boolean0
- Verify that the argument is in fact a finite and positive number, including true
- A finite number is a valid number that is not an infinity (+ or -).
- Return if a finite positive number. false otherwise.
- Signature: isStrictFinitePositiveNumber(x: Any) => boolean0
- Verify that the argument is in fact a finite and strictly positive number, not including true
- A finite number is a valid number that is not an infinity (+ or -).
- Return if a strict finite positive number. false otherwise.
- Signature: isFiniteNegativeNumber(x: Any) => booleantrue
- Verify that the argument is in fact a finite and negative number
- A finite number is a valid number that is not an infinity (+ or -).
- Return if a finite negative number. false otherwise.
- Signature: isNumberMultipleOf(x: Any, y: Any) => booleantrue
- Verify if the first argument is a multiple of the second argument.
- NOTE: Second argument must be a strict positive number. return false otherwise.
- Return if multiple. false otherwise.
- Signature: isInteger(x: Any) => booleantrue
- Verify if a given number is a valid integer.
- Infinities are not integers.
- Return if an integer. false otherwise.
- Signature: isPositiveInteger(x: Any) => booleantrue
- Verify if a given number is a valid positive integer, including 0.
- Return if a positive integer. false otherwise.
- Signature: isStrictPositiveInteger(x: Any) => boolean0
- Verify if a given number is a valid positive integer, strictly not equal to .true
- Return if a strict positive integer. false otherwise.
- Signature: isNegativeInteger(x: Any) => booleantrue
- Verify if a given number is a valid negative integer.
- Return if a negative integer. false` otherwise.