@@ -25,51 +25,54 @@ var numbers = [
25
25
0 ,
26
26
1 ,
27
27
2 ,
28
- 0x7f , // ~7 bits
28
+ 0x7f , // ~7 bits
29
29
0x80 ,
30
- 0xff , // ~8 bits
30
+ 0xff , // ~8 bits
31
31
0x100 ,
32
- 0xffff , // ~16 bits
32
+ 0xffff , // ~16 bits
33
33
0x10000 ,
34
- 0x3fffffff , // ~30 bits (max positive 32-bit tagged smi)
34
+ 0x3fffffff , // ~30 bits (max positive 32-bit tagged smi)
35
35
0x40000000 ,
36
36
0x40000001 ,
37
- 0x7fffffff , // ~31 bits
37
+ 0x7fffffff , // ~31 bits
38
38
0x80000000 ,
39
39
0x80000001 ,
40
- 0xfffffffff , // ~32 bits
40
+ 0xfffffffff , // ~32 bits
41
41
0x100000000 ,
42
42
0x100000001 ,
43
- 0x10000000000000 , // ~53 bits
43
+ 0x10000000000000 , // ~53 bits
44
44
0x10000000000001 ,
45
45
0x1fffffffffffff ,
46
46
0x20000000000000 ,
47
- 0x20000000000001 , // first integer not representable as double.
48
- 0x20000000000002 ,
49
- 0x7fffffffffffffff , // ~63 bits
47
+ // Use arithmetic to construct values below since they are not valid 'web
48
+ // integers'. On platforms that use doubles to represent integers, there will
49
+ // be some rounding in the arithmetic, testing a nearby value instead.
50
+ 0x20000000000000 + 1 , // first integer not representable as double.
51
+ 0x20000000000000 + 2 ,
52
+ 0x7ffffffffffff000 + 0xfff , // ~63 bits
50
53
0x8000000000000000 ,
51
- 0x8000000000000001 ,
52
- 0xffffffffffffffff , // ~64 bits
54
+ 0x8000000000000000 + 1 ,
55
+ 0xfffffffffffff000 + 0xfff , // ~64 bits
53
56
// Doubles.
54
57
0.0 ,
55
- 5e-324 , // min positive
56
- 2.225073858507201e-308 , // max denormal
57
- 2.2250738585072014e-308 , // min normal
58
- 0.49999999999999994 , // ~0.5
58
+ 5e-324 , // min positive
59
+ 2.225073858507201e-308 , // max denormal
60
+ 2.2250738585072014e-308 , // min normal
61
+ 0.49999999999999994 , // ~0.5
59
62
0.5 ,
60
63
0.5000000000000001 ,
61
- 0.9999999999999999 , // ~1.0
64
+ 0.9999999999999999 , // ~1.0
62
65
1.0 ,
63
66
1.0000000000000002 ,
64
- 4294967295.0 , // ~32 bits
67
+ 4294967295.0 , // ~32 bits
65
68
4294967296.0 ,
66
- 4503599627370495.5 , // max fractional
69
+ 4503599627370495.5 , // max fractional
67
70
4503599627370497.0 ,
68
71
9007199254740991.0 ,
69
- 9007199254740992.0 , // max exact (+1 is not a double)
70
- 1.7976931348623157e+308 , // max finite double
71
- 1.0 / 0.0 , // Infinity
72
- 0.0 / 0.0 , // NaN
72
+ 9007199254740992.0 , // max exact (+1 is not a double)
73
+ 1.7976931348623157e+308 , // max finite double
74
+ 1.0 / 0.0 , // Infinity
75
+ 0.0 / 0.0 , // NaN
73
76
];
74
77
75
78
main () {
0 commit comments