Travis build: 831

This commit is contained in:
30secondsofcode
2018-11-21 19:04:00 +00:00
parent abacae9e63
commit 489ea40812
17 changed files with 43 additions and 14 deletions

View File

@ -321,6 +321,7 @@ average(1, 2, 3);
* [`inRange`](#inrange)
* [`isDivisible`](#isdivisible)
* [`isEven`](#iseven)
* [`isNegativeZero`](#isnegativezero)
* [`isPrime`](#isprime)
* [`lcm`](#lcm)
* [`luhnCheck`](#luhncheck-)
@ -5675,6 +5676,28 @@ isEven(3); // false
<br>[⬆ Back to top](#contents)
### isNegativeZero
Checks if the given value is equal to negative zero (`-0`).
Checks whether a passed value is equal to `0` and if `1` divided by the value equals `-Infinity`.
```js
const isNegativeZero = val => val === 0 && 1 / val === -Infinity;
```
<details>
<summary>Examples</summary>
```js
isNegativeZero(-0); // true
isNegativeZero(0); // false
```
</details>
<br>[⬆ Back to top](#contents)
### isPrime
Checks if the provided integer is a prime number.