minor fixes
This commit is contained in:
parent
2901e0c645
commit
98e7e6bf23
1 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,7 @@ In modern JavaScript, there are two types of numbers:
|
||||||
|
|
||||||
1. Regular numbers in JavaScript are stored in 64-bit format [IEEE-754](https://en.wikipedia.org/wiki/IEEE_754-2008_revision), also known as "double precision floating point numbers". These are numbers that we're using most of the time, and we'll talk about them in this chapter.
|
1. Regular numbers in JavaScript are stored in 64-bit format [IEEE-754](https://en.wikipedia.org/wiki/IEEE_754-2008_revision), also known as "double precision floating point numbers". These are numbers that we're using most of the time, and we'll talk about them in this chapter.
|
||||||
|
|
||||||
2. BigInt numbers, to represent integers of arbitrary length. They are sometimes needed, because a regular number can't safely exceed <code>2<sup>53</sup></code> or be less than <code>-2<sup>53</sup></code>. As bigints are used in few special areas, we devote them a special chapter <info:bigint>.
|
2. BigInt numbers represent integers of arbitrary length. They are sometimes needed because a regular number can't safely exceed <code>2<sup>53</sup></code> or be less than <code>-2<sup>53</sup></code>. As bigints are used in few special areas, we devote them a special chapter <info:bigint>.
|
||||||
|
|
||||||
So here we'll talk about regular numbers. Let's expand our knowledge of them.
|
So here we'll talk about regular numbers. Let's expand our knowledge of them.
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ They belong to the type `number`, but are not "normal" numbers, so there are spe
|
||||||
alert( isNaN("str") ); // true
|
alert( isNaN("str") ); // true
|
||||||
```
|
```
|
||||||
|
|
||||||
But do we need this function? Can't we just use the comparison `=== NaN`? Sorry, but the answer is no. The value `NaN` is unique in that it does not equal anything, including itself:
|
But do we need this function? Can't we just use the comparison `=== NaN`? Unfortunately not. The value `NaN` is unique in that it does not equal anything, including itself:
|
||||||
|
|
||||||
```js run
|
```js run
|
||||||
alert( NaN === NaN ); // false
|
alert( NaN === NaN ); // false
|
||||||
|
@ -399,7 +399,7 @@ A few examples:
|
||||||
alert( Math.random() ); // ... (any random numbers)
|
alert( Math.random() ); // ... (any random numbers)
|
||||||
```
|
```
|
||||||
|
|
||||||
`Math.max(a, b, c...)` / `Math.min(a, b, c...)`
|
`Math.max(a, b, c...)` and `Math.min(a, b, c...)`
|
||||||
: Returns the greatest/smallest from the arbitrary number of arguments.
|
: Returns the greatest/smallest from the arbitrary number of arguments.
|
||||||
|
|
||||||
```js run
|
```js run
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue