@cj-tech-master/excelts 9.3.0 → 9.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/modules/formula/functions/date.js +2 -4
- package/dist/browser/modules/formula/functions/statistical.js +2 -4
- package/dist/browser/modules/formula/runtime/evaluator.js +1 -2
- package/dist/cjs/modules/formula/functions/date.js +2 -4
- package/dist/cjs/modules/formula/functions/statistical.js +2 -4
- package/dist/cjs/modules/formula/runtime/evaluator.js +1 -2
- package/dist/esm/modules/formula/functions/date.js +2 -4
- package/dist/esm/modules/formula/functions/statistical.js +2 -4
- package/dist/esm/modules/formula/runtime/evaluator.js +1 -2
- package/dist/iife/excelts.iife.js +1 -1
- package/dist/iife/excelts.iife.min.js +1 -1
- package/package.json +1 -1
|
@@ -120,11 +120,9 @@ export const fnDATE = args => {
|
|
|
120
120
|
return ERRORS.NUM;
|
|
121
121
|
}
|
|
122
122
|
if (y < 1900) {
|
|
123
|
+
// Excel's DATE interprets a year in [0, 1899] as (year + 1900). After this
|
|
124
|
+
// coercion `y` is in [1900, 3799], always within Excel's [1900, 9999] range.
|
|
123
125
|
y += 1900;
|
|
124
|
-
// Excel rejects years outside [1900, 9999] after this coercion.
|
|
125
|
-
if (y > 9999) {
|
|
126
|
-
return ERRORS.NUM;
|
|
127
|
-
}
|
|
128
126
|
}
|
|
129
127
|
// Lotus 1-2-3 bug: DATE(1900,2,29) should return serial 60 even though
|
|
130
128
|
// 1900 is not a leap year. JavaScript's Date constructor rolls Feb 29, 1900
|
|
@@ -1150,14 +1150,13 @@ function betaIncomplete(x, a, b) {
|
|
|
1150
1150
|
if (!Number.isFinite(front) || front === 0) {
|
|
1151
1151
|
return 0;
|
|
1152
1152
|
}
|
|
1153
|
-
let f = 1;
|
|
1154
1153
|
let c = 1;
|
|
1155
1154
|
let d = 1 - ((a + b) * x) / (a + 1);
|
|
1156
1155
|
if (Math.abs(d) < 1e-30) {
|
|
1157
1156
|
d = 1e-30;
|
|
1158
1157
|
}
|
|
1159
1158
|
d = 1 / d;
|
|
1160
|
-
f = d;
|
|
1159
|
+
let f = d;
|
|
1161
1160
|
for (let m = 1; m <= 200; m++) {
|
|
1162
1161
|
let num = (m * (b - m) * x) / ((a + 2 * m - 1) * (a + 2 * m));
|
|
1163
1162
|
d = 1 + num * d;
|
|
@@ -1207,11 +1206,10 @@ function gammaIncomplete(a, x) {
|
|
|
1207
1206
|
}
|
|
1208
1207
|
return sum * Math.exp(-x + a * Math.log(x) - lnGamma(a));
|
|
1209
1208
|
}
|
|
1210
|
-
let f = 1;
|
|
1211
1209
|
const b0 = x + 1 - a;
|
|
1212
1210
|
let ci = 1e30;
|
|
1213
1211
|
let d = 1 / b0;
|
|
1214
|
-
f = d;
|
|
1212
|
+
let f = d;
|
|
1215
1213
|
for (let i = 1; i <= 200; i++) {
|
|
1216
1214
|
const an = -i * (i - a);
|
|
1217
1215
|
const bn = x + 2 * i + 1 - a;
|
|
@@ -2023,7 +2023,7 @@ function evaluateStructuredRef(expr, ctx, session) {
|
|
|
2023
2023
|
const snapshot = ctx.snapshot;
|
|
2024
2024
|
const addr = ctx.currentAddress;
|
|
2025
2025
|
// Find the table
|
|
2026
|
-
|
|
2026
|
+
const tableName = expr.tableName;
|
|
2027
2027
|
let tableSheet = null;
|
|
2028
2028
|
let tableInfo = null;
|
|
2029
2029
|
if (tableName === "") {
|
|
@@ -2049,7 +2049,6 @@ function evaluateStructuredRef(expr, ctx, session) {
|
|
|
2049
2049
|
addr.col < t.topLeft.col + width) {
|
|
2050
2050
|
tableInfo = t;
|
|
2051
2051
|
tableSheet = ws.name;
|
|
2052
|
-
tableName = t.name;
|
|
2053
2052
|
break;
|
|
2054
2053
|
}
|
|
2055
2054
|
}
|
|
@@ -128,11 +128,9 @@ const fnDATE = args => {
|
|
|
128
128
|
return values_1.ERRORS.NUM;
|
|
129
129
|
}
|
|
130
130
|
if (y < 1900) {
|
|
131
|
+
// Excel's DATE interprets a year in [0, 1899] as (year + 1900). After this
|
|
132
|
+
// coercion `y` is in [1900, 3799], always within Excel's [1900, 9999] range.
|
|
131
133
|
y += 1900;
|
|
132
|
-
// Excel rejects years outside [1900, 9999] after this coercion.
|
|
133
|
-
if (y > 9999) {
|
|
134
|
-
return values_1.ERRORS.NUM;
|
|
135
|
-
}
|
|
136
134
|
}
|
|
137
135
|
// Lotus 1-2-3 bug: DATE(1900,2,29) should return serial 60 even though
|
|
138
136
|
// 1900 is not a leap year. JavaScript's Date constructor rolls Feb 29, 1900
|
|
@@ -1198,14 +1198,13 @@ function betaIncomplete(x, a, b) {
|
|
|
1198
1198
|
if (!Number.isFinite(front) || front === 0) {
|
|
1199
1199
|
return 0;
|
|
1200
1200
|
}
|
|
1201
|
-
let f = 1;
|
|
1202
1201
|
let c = 1;
|
|
1203
1202
|
let d = 1 - ((a + b) * x) / (a + 1);
|
|
1204
1203
|
if (Math.abs(d) < 1e-30) {
|
|
1205
1204
|
d = 1e-30;
|
|
1206
1205
|
}
|
|
1207
1206
|
d = 1 / d;
|
|
1208
|
-
f = d;
|
|
1207
|
+
let f = d;
|
|
1209
1208
|
for (let m = 1; m <= 200; m++) {
|
|
1210
1209
|
let num = (m * (b - m) * x) / ((a + 2 * m - 1) * (a + 2 * m));
|
|
1211
1210
|
d = 1 + num * d;
|
|
@@ -1255,11 +1254,10 @@ function gammaIncomplete(a, x) {
|
|
|
1255
1254
|
}
|
|
1256
1255
|
return sum * Math.exp(-x + a * Math.log(x) - lnGamma(a));
|
|
1257
1256
|
}
|
|
1258
|
-
let f = 1;
|
|
1259
1257
|
const b0 = x + 1 - a;
|
|
1260
1258
|
let ci = 1e30;
|
|
1261
1259
|
let d = 1 / b0;
|
|
1262
|
-
f = d;
|
|
1260
|
+
let f = d;
|
|
1263
1261
|
for (let i = 1; i <= 200; i++) {
|
|
1264
1262
|
const an = -i * (i - a);
|
|
1265
1263
|
const bn = x + 2 * i + 1 - a;
|
|
@@ -2030,7 +2030,7 @@ function evaluateStructuredRef(expr, ctx, session) {
|
|
|
2030
2030
|
const snapshot = ctx.snapshot;
|
|
2031
2031
|
const addr = ctx.currentAddress;
|
|
2032
2032
|
// Find the table
|
|
2033
|
-
|
|
2033
|
+
const tableName = expr.tableName;
|
|
2034
2034
|
let tableSheet = null;
|
|
2035
2035
|
let tableInfo = null;
|
|
2036
2036
|
if (tableName === "") {
|
|
@@ -2056,7 +2056,6 @@ function evaluateStructuredRef(expr, ctx, session) {
|
|
|
2056
2056
|
addr.col < t.topLeft.col + width) {
|
|
2057
2057
|
tableInfo = t;
|
|
2058
2058
|
tableSheet = ws.name;
|
|
2059
|
-
tableName = t.name;
|
|
2060
2059
|
break;
|
|
2061
2060
|
}
|
|
2062
2061
|
}
|
|
@@ -120,11 +120,9 @@ export const fnDATE = args => {
|
|
|
120
120
|
return ERRORS.NUM;
|
|
121
121
|
}
|
|
122
122
|
if (y < 1900) {
|
|
123
|
+
// Excel's DATE interprets a year in [0, 1899] as (year + 1900). After this
|
|
124
|
+
// coercion `y` is in [1900, 3799], always within Excel's [1900, 9999] range.
|
|
123
125
|
y += 1900;
|
|
124
|
-
// Excel rejects years outside [1900, 9999] after this coercion.
|
|
125
|
-
if (y > 9999) {
|
|
126
|
-
return ERRORS.NUM;
|
|
127
|
-
}
|
|
128
126
|
}
|
|
129
127
|
// Lotus 1-2-3 bug: DATE(1900,2,29) should return serial 60 even though
|
|
130
128
|
// 1900 is not a leap year. JavaScript's Date constructor rolls Feb 29, 1900
|
|
@@ -1150,14 +1150,13 @@ function betaIncomplete(x, a, b) {
|
|
|
1150
1150
|
if (!Number.isFinite(front) || front === 0) {
|
|
1151
1151
|
return 0;
|
|
1152
1152
|
}
|
|
1153
|
-
let f = 1;
|
|
1154
1153
|
let c = 1;
|
|
1155
1154
|
let d = 1 - ((a + b) * x) / (a + 1);
|
|
1156
1155
|
if (Math.abs(d) < 1e-30) {
|
|
1157
1156
|
d = 1e-30;
|
|
1158
1157
|
}
|
|
1159
1158
|
d = 1 / d;
|
|
1160
|
-
f = d;
|
|
1159
|
+
let f = d;
|
|
1161
1160
|
for (let m = 1; m <= 200; m++) {
|
|
1162
1161
|
let num = (m * (b - m) * x) / ((a + 2 * m - 1) * (a + 2 * m));
|
|
1163
1162
|
d = 1 + num * d;
|
|
@@ -1207,11 +1206,10 @@ function gammaIncomplete(a, x) {
|
|
|
1207
1206
|
}
|
|
1208
1207
|
return sum * Math.exp(-x + a * Math.log(x) - lnGamma(a));
|
|
1209
1208
|
}
|
|
1210
|
-
let f = 1;
|
|
1211
1209
|
const b0 = x + 1 - a;
|
|
1212
1210
|
let ci = 1e30;
|
|
1213
1211
|
let d = 1 / b0;
|
|
1214
|
-
f = d;
|
|
1212
|
+
let f = d;
|
|
1215
1213
|
for (let i = 1; i <= 200; i++) {
|
|
1216
1214
|
const an = -i * (i - a);
|
|
1217
1215
|
const bn = x + 2 * i + 1 - a;
|
|
@@ -2023,7 +2023,7 @@ function evaluateStructuredRef(expr, ctx, session) {
|
|
|
2023
2023
|
const snapshot = ctx.snapshot;
|
|
2024
2024
|
const addr = ctx.currentAddress;
|
|
2025
2025
|
// Find the table
|
|
2026
|
-
|
|
2026
|
+
const tableName = expr.tableName;
|
|
2027
2027
|
let tableSheet = null;
|
|
2028
2028
|
let tableInfo = null;
|
|
2029
2029
|
if (tableName === "") {
|
|
@@ -2049,7 +2049,6 @@ function evaluateStructuredRef(expr, ctx, session) {
|
|
|
2049
2049
|
addr.col < t.topLeft.col + width) {
|
|
2050
2050
|
tableInfo = t;
|
|
2051
2051
|
tableSheet = ws.name;
|
|
2052
|
-
tableName = t.name;
|
|
2053
2052
|
break;
|
|
2054
2053
|
}
|
|
2055
2054
|
}
|