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
var x = 0x20000000000001; // 2^53 + 1 (Invalid, precision loss)
45
+
var x = 9007199254740993; // 2^53 + 1 (Invalid, precision loss)
46
+
var x = 0x10000000000000000000000001; // 2^100 + 1 (Invalid, precision loss)
47
+
// 2^1024 (Overflow, Invalid)
48
+
var x = 0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
× This number literal will lose precision at runtime.
685
+
686
+
38 │ var x = 0x20000000000001; // 2^53 + 1 (Invalid, precision loss)
687
+
39 │ var x = 9007199254740993; // 2^53 + 1 (Invalid, precision loss)
688
+
> 40 │ var x = 0x10000000000000000000000001; // 2^100 + 1 (Invalid, precision loss)
689
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
690
+
41 │ // 2^1024 (Overflow, Invalid)
691
+
42 │ var x = 0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
692
+
693
+
i The value at runtime will be 1267650600228229400000000000000
× This number literal will lose precision at runtime.
702
+
703
+
40 │ var x = 0x10000000000000000000000001; // 2^100 + 1 (Invalid, precision loss)
704
+
41 │ // 2^1024 (Overflow, Invalid)
705
+
> 42 │ var x = 0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
Copy file name to clipboardExpand all lines: crates/biome_js_analyze/tests/specs/correctness/noPrecisionLoss/valid.js.snap
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -83,4 +83,11 @@ var x = 0X1_FFF_FFFF_FFF_FFF
83
83
84
84
var MAX = 1.7976931348623157e+308;
85
85
var MIN = 5e-324;
86
+
// From repro_issue.js
87
+
var x = 0x20000000000000; // 2^53 (Valid)
88
+
var x = 9007199254740992; // 2^53 (Valid)
89
+
var x = 0x10000000000000000000000000; // 2^100 (Valid)
90
+
// 2^1023 (Max exponent, Valid)
91
+
var x = 0x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
0 commit comments