Why does a decimal number need a different form before it can be stored? JavaScript interprets decimal notation, converts the value to binary, then encodes it in bytes. Each step can constrain what is represented accurately. section 3.1.1
Binary uses place values that are powers of two: 1011 means 8 + 0 + 2 + 1, or 11 in decimal. section 3.1.1
In a byte, the rightmost bit is least significant and the leftmost is most significant. An unset bit is 0; a set bit is 1. Whole-number bit patterns do not, by themselves, represent fractions such as 0.1. Signed integers introduce another encoding choice: in eight-bit two’s complement, −1 is represented by eight set bits. section 3.1.1
Table 3.3 Representing 0.1 and 0.2 as floating-point numbers
|
Value
|
Sign
|
Exponent
|
Significand
|
|
0.1
|
0
|
01111111011
|
1.1001100110011001100110011001100110011001100110011010
|
|
0.2
|
0
|
01111111100
|
1.1001100110011001100110011001100110011001100110011010
|
The floating-point encodings of 0.1 and 0.2 show how fractional values are represented using sign, exponent and significand fields rather than a whole-number bit pattern. section 3.1.1






