➖ Checks if a number is negative zero (
-0).
In JavaScript, standard equality 0 === -0 returns true. Use this function or Object.is() to distinguish them.
Syntax
import { isNegZero } from '@opentf/std';
isNegZero(n: number): booleanParameters
n: The number to check.
Returns
true if the number is -0, false otherwise.
Examples
isNegZero(0) //=> false
isNegZero(-0) //=> true
isNegZero(-0.0) //=> true
isNegZero(-0x0) //=> true