You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/05-data-types/02-number/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -185,21 +185,21 @@ There are two ways to do so:
185
185
alert( num.toFixed(5) ); // "12.34000", added zeroes to make exactly 5 digits
186
186
```
187
187
188
-
We can convert it to a number using the unary plus or a `Number()` call: `+num.toFixed(5)`.
188
+
We can convert it to a number using the unary plus or a `Number()` call, e.g write `+num.toFixed(5)`.
189
189
190
190
## Imprecise calculations
191
191
192
192
Internally, a number is represented in 64-bit format [IEEE-754](https://en.wikipedia.org/wiki/IEEE_754-2008_revision), so there are exactly 64 bits to store a number: 52 of them are used to store the digits, 11 of them store the position of the decimal point (they are zero for integer numbers), and 1 bit is for the sign.
193
193
194
-
If a number is too big, it would overflow the 64-bit storage, potentially giving an infinity:
194
+
If a number is really huge, it may overflow the 64-bit storage and become a special numeric value `Infinity`:
195
195
196
196
```js run
197
197
alert( 1e500 ); // Infinity
198
198
```
199
199
200
200
What may be a little less obvious, but happens quite often, is the loss of precision.
0 commit comments