@technobuddha/library
Version:
A large library of useful functions
18 lines • 814 B
JavaScript
/**
* Tests to see if the specified value is negative zero
* @param input - The number to test
* @returns true is the number is negative zero
* @example
* ```typescript
* isNegativeZero(-0); // true
* isNegativeZero(0); // false
* isNegativeZero(1); // false
* isNegativeZero(-1); // false
* ```
* @group Math
* @category Comparison
*/
export function isNegativeZero(input) {
return input === 0 && 1 / input < 0;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXMtbmVnYXRpdmUtemVyby5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pcy1uZWdhdGl2ZS16ZXJvLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7QUFDSCxNQUFNLFVBQVUsY0FBYyxDQUFDLEtBQWE7SUFDMUMsT0FBTyxLQUFLLEtBQUssQ0FBQyxJQUFJLENBQUMsR0FBRyxLQUFLLEdBQUcsQ0FBQyxDQUFDO0FBQ3RDLENBQUMifQ==