We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function negativeZero(val: unknown): val is 0 { return is.number(val) && val === 0 && 1 / val === -Infinity; }
(Type-level typescript doesn't differentiate between +0 and -0; JS runtime does, if you look closely enough.)
The text was updated successfully, but these errors were encountered:
Object.is(value, -0) is the easiest way to do. Not sure it's worth adding here as you should almost never have to care about -0 in practice.
Object.is(value, -0)
-0
Sorry, something went wrong.
Didn't think of that! Tyvm.
No branches or pull requests
(Type-level typescript doesn't differentiate between +0 and -0; JS runtime does, if you look closely enough.)
The text was updated successfully, but these errors were encountered: