Skip to content

Commit 0e7674e

Browse files
committed
types-grammar, ch1: adding footnote for 'signed zero' wikipedia page
1 parent f3ac3ef commit 0e7674e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

types-grammar/ch1.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ Number.isSafeInteger(2 ** 53 - 1); // true
835835
836836
### Double Zeros
837837
838-
It may surprise you to learn that JS has two zeros: `0`, and `-0` (negative zero). But what on earth is a "negative zero"? A mathematician would surely balk at such a notion.
838+
It may surprise you to learn that JS has two zeros: `0`, and `-0` (negative zero). But what on earth is a "negative zero"? [^SignedZero] A mathematician would surely balk at such a notion.
839839
840840
This isn't just a funny JS quirk; it's mandated by the IEEE-754[^IEEE754] specification. All floating point numbers are signed, including zero. And though JS does kind of hide the existence of `-0`, it's entirely possible to produce it and to detect it:
841841
@@ -1119,3 +1119,5 @@ Before we move on to discussing JS's built-in object value type, we want to take
11191119
[^IEEE754]: "IEEE-754"; https://en.wikipedia.org/wiki/IEEE_754 ; Accessed July 2022
11201120
11211121
[^NumberType]: "6.1.6.1 The Number Type", ECMAScript 2022 Language Specification; https://262.ecma-international.org/13.0/#sec-ecmascript-language-types-number-type ; Accessed August 2022
1122+
1123+
[^SignedZero]: "Signed Zero", Wikipedia; https://en.wikipedia.org/wiki/Signed_zero ; Accessed August 2022

0 commit comments

Comments
 (0)