Skip to content

Instantly share code, notes, and snippets.

@gtk2k
Created August 17, 2015 10:07
Show Gist options
  • Save gtk2k/37e3aa7f4105687b9a56 to your computer and use it in GitHub Desktop.
Save gtk2k/37e3aa7f4105687b9a56 to your computer and use it in GitHub Desktop.
Javascript で -0 の判定
function isNegativeZero(x) {
return x === 0 && 1 / x === Number.NEGATIVE_INFINITY;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment