Commit 678ba3f
committed
fix: bigint AVG precision loss for sums exceeding 2^53
Number(bigintSum) in AVG computation lost precision when the running
sum exceeded Number.MAX_SAFE_INTEGER. Added bigIntAvg() helpers that
divide in BigInt space first (quotient + remainder) to preserve
precision. Fixed in partial-agg.ts (GROUP BY AVG) and operators.ts
(window AVG, both running and frame paths).1 parent 0e816f8 commit 678ba3f
2 files changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
1109 | 1116 | | |
1110 | 1117 | | |
1111 | 1118 | | |
1112 | | - | |
| 1119 | + | |
1113 | 1120 | | |
1114 | 1121 | | |
1115 | 1122 | | |
| |||
1133 | 1140 | | |
1134 | 1141 | | |
1135 | 1142 | | |
1136 | | - | |
| 1143 | + | |
1137 | 1144 | | |
1138 | 1145 | | |
1139 | 1146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| |||
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
105 | | - | |
| 114 | + | |
106 | 115 | | |
107 | 116 | | |
108 | 117 | | |
| |||
0 commit comments