umt 1.0.12 → 1.0.14
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/.github/workflows/test.yml +23 -0
- package/jest.config.js +13 -0
- package/make_test.py +24 -0
- package/module/Array/arraysJoin.js +6 -0
- package/module/Array/getArraysCommon.js +17 -13
- package/module/Array/getArraysDiff.js +5 -13
- package/module/Array/index.js +17 -17
- package/module/Date/index.js +5 -5
- package/module/Math/average.js +4 -2
- package/module/Math/calculator/calculatorInitialization.d.ts +6 -0
- package/module/Math/calculator/calculatorInitialization.js +17 -0
- package/module/Math/calculator/exchange.js +12 -0
- package/module/Math/calculator/index.d.ts +2 -2
- package/module/Math/calculator/index.js +5 -5
- package/module/Math/index.d.ts +6 -4
- package/module/Math/index.js +123 -116
- package/module/Math/isDouble.d.ts +2 -3
- package/module/Math/isDouble.js +2 -3
- package/module/Math/lcm.js +3 -0
- package/module/Math/roundOf.d.ts +7 -0
- package/module/Math/roundOf.js +14 -0
- package/module/Math/softmax.js +2 -2
- package/module/Math/subtract.js +9 -3
- package/module/Math/toCelsius.d.ts +5 -0
- package/module/Math/toCelsius.js +5 -0
- package/module/Math/valueSwap.d.ts +2 -2
- package/module/Math/valueSwap.js +1 -1
- package/module/Simple/Date/index.js +5 -5
- package/module/Simple/Math/dayOfWeek.d.ts +2 -2
- package/module/Simple/Math/dayOfWeek.js +9 -3
- package/module/Simple/Math/index.d.ts +2 -2
- package/module/Simple/Math/index.js +8 -8
- package/module/Simple/Tool/index.js +5 -5
- package/module/Simple/index.d.ts +1 -1
- package/module/Simple/index.js +12 -12
- package/module/Tool/dayOfWeek.d.ts +6 -5
- package/module/Tool/index.d.ts +3 -3
- package/module/Tool/index.js +20 -20
- package/module/index.d.ts +1 -1
- package/module/index.js +17 -17
- package/module/tsconfig.tsbuildinfo +1 -1
- package/module/types/monType.d.ts +5 -1
- package/package.json +39 -28
package/module/Math/index.js
CHANGED
|
@@ -10,15 +10,17 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
13
|
+
var _UMTMathClass_Local_addition, _UMTMathClass_Local_average, _UMTMathClass_Local_calculator, _UMTMathClass_Local_calculatorInitialization, _UMTMathClass_Local_degToRad, _UMTMathClass_Local_deviationValue, _UMTMathClass_Local_division, _UMTMathClass_Local_factorial, _UMTMathClass_Local_factorize, _UMTMathClass_Local_gcd, _UMTMathClass_Local_getDecimalLength, _UMTMathClass_Local_isDouble, _UMTMathClass_Local_isNumber, _UMTMathClass_Local_isPrimeNumber, _UMTMathClass_Local_lcm, _UMTMathClass_Local_mathConverter, _UMTMathClass_Local_mathSeparator, _UMTMathClass_Local_max, _UMTMathClass_Local_min, _UMTMathClass_Local_multiples, _UMTMathClass_Local_multiplication, _UMTMathClass_Local_nCr, _UMTMathClass_Local_nHr, _UMTMathClass_Local_nPr, _UMTMathClass_Local_primeFactorization, _UMTMathClass_Local_quotient, _UMTMathClass_Local_radToDeg, _UMTMathClass_Local_random, _UMTMathClass_Local_reduce, _UMTMathClass_Local_repeatedTrial, _UMTMathClass_Local_roundOf, _UMTMathClass_Local_softmax, _UMTMathClass_Local_standardDeviation, _UMTMathClass_Local_subtract, _UMTMathClass_Local_toBinary, _UMTMathClass_Local_toCelsius, _UMTMathClass_Local_toKelvin, _UMTMathClass_Local_valueSwap;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.UMT_Math = exports.UMTMathClass = exports.valueSwap = exports.toKelvin = exports.toCelsius = exports.toBinary = exports.subtract = exports.standardDeviation = exports.softmax = exports.roundOf = exports.repeatedTrial = exports.reduce = exports.random = exports.radToDeg = exports.quotient = exports.primeFactorization = exports.nPr = exports.nHr = exports.nCr = exports.multiplication = exports.multiples = exports.min = exports.max = exports.mathSeparator = exports.mathConverter = exports.lcm = exports.isPrimeNumber = exports.isNumber = exports.isDouble = exports.getDecimalLength = exports.gcd = exports.factorize = exports.factorial = exports.division = exports.deviationValue = exports.degToRad = exports.calculator = exports.average = exports.addition = void 0;
|
|
15
|
+
exports.UMT_Math = exports.UMTMathClass = exports.valueSwap = exports.toKelvin = exports.toCelsius = exports.toBinary = exports.subtract = exports.standardDeviation = exports.softmax = exports.roundOf = exports.repeatedTrial = exports.reduce = exports.random = exports.radToDeg = exports.quotient = exports.primeFactorization = exports.nPr = exports.nHr = exports.nCr = exports.multiplication = exports.multiples = exports.min = exports.max = exports.mathSeparator = exports.mathConverter = exports.lcm = exports.isPrimeNumber = exports.isNumber = exports.isDouble = exports.getDecimalLength = exports.gcd = exports.factorize = exports.factorial = exports.division = exports.deviationValue = exports.degToRad = exports.calculatorInitialization = exports.calculator = exports.average = exports.addition = void 0;
|
|
16
16
|
const addition_1 = require("./addition");
|
|
17
17
|
Object.defineProperty(exports, "addition", { enumerable: true, get: function () { return addition_1.addition; } });
|
|
18
18
|
const average_1 = require("./average");
|
|
19
19
|
Object.defineProperty(exports, "average", { enumerable: true, get: function () { return average_1.average; } });
|
|
20
20
|
const calculator_1 = require("./calculator");
|
|
21
21
|
Object.defineProperty(exports, "calculator", { enumerable: true, get: function () { return calculator_1.calculator; } });
|
|
22
|
+
const calculatorInitialization_1 = require("./calculator/calculatorInitialization");
|
|
23
|
+
Object.defineProperty(exports, "calculatorInitialization", { enumerable: true, get: function () { return calculatorInitialization_1.calculatorInitialization; } });
|
|
22
24
|
const degToRad_1 = require("./degToRad");
|
|
23
25
|
Object.defineProperty(exports, "degToRad", { enumerable: true, get: function () { return degToRad_1.degToRad; } });
|
|
24
26
|
const deviationValue_1 = require("./deviationValue");
|
|
@@ -71,8 +73,8 @@ const reduce_1 = require("./reduce");
|
|
|
71
73
|
Object.defineProperty(exports, "reduce", { enumerable: true, get: function () { return reduce_1.reduce; } });
|
|
72
74
|
const repeatedTrial_1 = require("./repeatedTrial");
|
|
73
75
|
Object.defineProperty(exports, "repeatedTrial", { enumerable: true, get: function () { return repeatedTrial_1.repeatedTrial; } });
|
|
74
|
-
const
|
|
75
|
-
Object.defineProperty(exports, "roundOf", { enumerable: true, get: function () { return
|
|
76
|
+
const roundOf_1 = require("./roundOf");
|
|
77
|
+
Object.defineProperty(exports, "roundOf", { enumerable: true, get: function () { return roundOf_1.roundOf; } });
|
|
76
78
|
const softmax_1 = require("./softmax");
|
|
77
79
|
Object.defineProperty(exports, "softmax", { enumerable: true, get: function () { return softmax_1.softmax; } });
|
|
78
80
|
const standardDeviation_1 = require("./standardDeviation");
|
|
@@ -89,193 +91,198 @@ const valueSwap_1 = require("./valueSwap");
|
|
|
89
91
|
Object.defineProperty(exports, "valueSwap", { enumerable: true, get: function () { return valueSwap_1.valueSwap; } });
|
|
90
92
|
class UMTMathClass {
|
|
91
93
|
constructor() {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
__classPrivateFieldSet(this,
|
|
131
|
-
__classPrivateFieldSet(this,
|
|
132
|
-
__classPrivateFieldSet(this,
|
|
133
|
-
__classPrivateFieldSet(this,
|
|
134
|
-
__classPrivateFieldSet(this,
|
|
135
|
-
__classPrivateFieldSet(this,
|
|
136
|
-
__classPrivateFieldSet(this,
|
|
137
|
-
__classPrivateFieldSet(this,
|
|
138
|
-
__classPrivateFieldSet(this,
|
|
139
|
-
__classPrivateFieldSet(this,
|
|
140
|
-
__classPrivateFieldSet(this,
|
|
141
|
-
__classPrivateFieldSet(this,
|
|
142
|
-
__classPrivateFieldSet(this,
|
|
143
|
-
__classPrivateFieldSet(this,
|
|
144
|
-
__classPrivateFieldSet(this,
|
|
145
|
-
__classPrivateFieldSet(this,
|
|
146
|
-
__classPrivateFieldSet(this,
|
|
147
|
-
__classPrivateFieldSet(this,
|
|
148
|
-
__classPrivateFieldSet(this,
|
|
149
|
-
__classPrivateFieldSet(this,
|
|
150
|
-
__classPrivateFieldSet(this,
|
|
151
|
-
__classPrivateFieldSet(this,
|
|
152
|
-
__classPrivateFieldSet(this,
|
|
153
|
-
__classPrivateFieldSet(this,
|
|
154
|
-
__classPrivateFieldSet(this,
|
|
155
|
-
__classPrivateFieldSet(this,
|
|
156
|
-
__classPrivateFieldSet(this,
|
|
157
|
-
__classPrivateFieldSet(this,
|
|
158
|
-
__classPrivateFieldSet(this,
|
|
159
|
-
__classPrivateFieldSet(this,
|
|
160
|
-
__classPrivateFieldSet(this,
|
|
161
|
-
__classPrivateFieldSet(this,
|
|
162
|
-
__classPrivateFieldSet(this,
|
|
163
|
-
__classPrivateFieldSet(this,
|
|
164
|
-
__classPrivateFieldSet(this,
|
|
165
|
-
__classPrivateFieldSet(this,
|
|
94
|
+
_UMTMathClass_Local_addition.set(this, void 0);
|
|
95
|
+
_UMTMathClass_Local_average.set(this, void 0);
|
|
96
|
+
_UMTMathClass_Local_calculator.set(this, void 0);
|
|
97
|
+
_UMTMathClass_Local_calculatorInitialization.set(this, void 0);
|
|
98
|
+
_UMTMathClass_Local_degToRad.set(this, void 0);
|
|
99
|
+
_UMTMathClass_Local_deviationValue.set(this, void 0);
|
|
100
|
+
_UMTMathClass_Local_division.set(this, void 0);
|
|
101
|
+
_UMTMathClass_Local_factorial.set(this, void 0);
|
|
102
|
+
_UMTMathClass_Local_factorize.set(this, void 0);
|
|
103
|
+
_UMTMathClass_Local_gcd.set(this, void 0);
|
|
104
|
+
_UMTMathClass_Local_getDecimalLength.set(this, void 0);
|
|
105
|
+
_UMTMathClass_Local_isDouble.set(this, void 0);
|
|
106
|
+
_UMTMathClass_Local_isNumber.set(this, void 0);
|
|
107
|
+
_UMTMathClass_Local_isPrimeNumber.set(this, void 0);
|
|
108
|
+
_UMTMathClass_Local_lcm.set(this, void 0);
|
|
109
|
+
_UMTMathClass_Local_mathConverter.set(this, void 0);
|
|
110
|
+
_UMTMathClass_Local_mathSeparator.set(this, void 0);
|
|
111
|
+
_UMTMathClass_Local_max.set(this, void 0);
|
|
112
|
+
_UMTMathClass_Local_min.set(this, void 0);
|
|
113
|
+
_UMTMathClass_Local_multiples.set(this, void 0);
|
|
114
|
+
_UMTMathClass_Local_multiplication.set(this, void 0);
|
|
115
|
+
_UMTMathClass_Local_nCr.set(this, void 0);
|
|
116
|
+
_UMTMathClass_Local_nHr.set(this, void 0);
|
|
117
|
+
_UMTMathClass_Local_nPr.set(this, void 0);
|
|
118
|
+
_UMTMathClass_Local_primeFactorization.set(this, void 0);
|
|
119
|
+
_UMTMathClass_Local_quotient.set(this, void 0);
|
|
120
|
+
_UMTMathClass_Local_radToDeg.set(this, void 0);
|
|
121
|
+
_UMTMathClass_Local_random.set(this, void 0);
|
|
122
|
+
_UMTMathClass_Local_reduce.set(this, void 0);
|
|
123
|
+
_UMTMathClass_Local_repeatedTrial.set(this, void 0);
|
|
124
|
+
_UMTMathClass_Local_roundOf.set(this, void 0);
|
|
125
|
+
_UMTMathClass_Local_softmax.set(this, void 0);
|
|
126
|
+
_UMTMathClass_Local_standardDeviation.set(this, void 0);
|
|
127
|
+
_UMTMathClass_Local_subtract.set(this, void 0);
|
|
128
|
+
_UMTMathClass_Local_toBinary.set(this, void 0);
|
|
129
|
+
_UMTMathClass_Local_toCelsius.set(this, void 0);
|
|
130
|
+
_UMTMathClass_Local_toKelvin.set(this, void 0);
|
|
131
|
+
_UMTMathClass_Local_valueSwap.set(this, void 0);
|
|
132
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_addition, addition_1.addition, "f");
|
|
133
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_average, average_1.average, "f");
|
|
134
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_calculator, calculator_1.calculator, "f");
|
|
135
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_calculatorInitialization, calculatorInitialization_1.calculatorInitialization, "f");
|
|
136
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_degToRad, degToRad_1.degToRad, "f");
|
|
137
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_deviationValue, deviationValue_1.deviationValue, "f");
|
|
138
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_division, division_1.division, "f");
|
|
139
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_factorial, factorial_1.factorial, "f");
|
|
140
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_factorize, factorize_1.factorize, "f");
|
|
141
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_gcd, gcd_1.gcd, "f");
|
|
142
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_getDecimalLength, getDecimalLength_1.getDecimalLength, "f");
|
|
143
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_isDouble, isDouble_1.isDouble, "f");
|
|
144
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_isNumber, isNumber_1.isNumber, "f");
|
|
145
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_isPrimeNumber, isPrimeNumber_1.isPrimeNumber, "f");
|
|
146
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_lcm, lcm_1.lcm, "f");
|
|
147
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_mathConverter, mathConverter_1.mathConverter, "f");
|
|
148
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_mathSeparator, mathSeparator_1.mathSeparator, "f");
|
|
149
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_max, max_1.max, "f");
|
|
150
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_min, min_1.min, "f");
|
|
151
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_multiples, multiples_1.multiples, "f");
|
|
152
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_multiplication, multiplication_1.multiplication, "f");
|
|
153
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_nCr, nCr_1.nCr, "f");
|
|
154
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_nHr, nHr_1.nHr, "f");
|
|
155
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_nPr, nPr_1.nPr, "f");
|
|
156
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_primeFactorization, primeFactorization_1.primeFactorization, "f");
|
|
157
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_quotient, quotient_1.quotient, "f");
|
|
158
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_radToDeg, radToDeg_1.radToDeg, "f");
|
|
159
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_random, random_1.random, "f");
|
|
160
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_reduce, reduce_1.reduce, "f");
|
|
161
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_repeatedTrial, repeatedTrial_1.repeatedTrial, "f");
|
|
162
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_roundOf, roundOf_1.roundOf, "f");
|
|
163
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_softmax, softmax_1.softmax, "f");
|
|
164
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_standardDeviation, standardDeviation_1.standardDeviation, "f");
|
|
165
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_subtract, subtract_1.subtract, "f");
|
|
166
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_toBinary, toBinary_1.toBinary, "f");
|
|
167
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_toCelsius, toCelsius_1.toCelsius, "f");
|
|
168
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_toKelvin, toKelvin_1.toKelvin, "f");
|
|
169
|
+
__classPrivateFieldSet(this, _UMTMathClass_Local_valueSwap, valueSwap_1.valueSwap, "f");
|
|
166
170
|
}
|
|
167
171
|
get addition() {
|
|
168
|
-
return __classPrivateFieldGet(this,
|
|
172
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_addition, "f");
|
|
169
173
|
}
|
|
170
174
|
get average() {
|
|
171
|
-
return __classPrivateFieldGet(this,
|
|
175
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_average, "f");
|
|
172
176
|
}
|
|
173
177
|
get calculator() {
|
|
174
|
-
return __classPrivateFieldGet(this,
|
|
178
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_calculator, "f");
|
|
179
|
+
}
|
|
180
|
+
get calculatorInitialization() {
|
|
181
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_calculatorInitialization, "f");
|
|
175
182
|
}
|
|
176
183
|
get degToRad() {
|
|
177
|
-
return __classPrivateFieldGet(this,
|
|
184
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_degToRad, "f");
|
|
178
185
|
}
|
|
179
186
|
get deviationValue() {
|
|
180
|
-
return __classPrivateFieldGet(this,
|
|
187
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_deviationValue, "f");
|
|
181
188
|
}
|
|
182
189
|
get division() {
|
|
183
|
-
return __classPrivateFieldGet(this,
|
|
190
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_division, "f");
|
|
184
191
|
}
|
|
185
192
|
get factorial() {
|
|
186
|
-
return __classPrivateFieldGet(this,
|
|
193
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_factorial, "f");
|
|
187
194
|
}
|
|
188
195
|
get factorize() {
|
|
189
|
-
return __classPrivateFieldGet(this,
|
|
196
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_factorize, "f");
|
|
190
197
|
}
|
|
191
198
|
get gcd() {
|
|
192
|
-
return __classPrivateFieldGet(this,
|
|
199
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_gcd, "f");
|
|
193
200
|
}
|
|
194
201
|
get getDecimalLength() {
|
|
195
|
-
return __classPrivateFieldGet(this,
|
|
202
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_getDecimalLength, "f");
|
|
196
203
|
}
|
|
197
204
|
get isDouble() {
|
|
198
|
-
return __classPrivateFieldGet(this,
|
|
205
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_isDouble, "f");
|
|
199
206
|
}
|
|
200
207
|
get isNumber() {
|
|
201
|
-
return __classPrivateFieldGet(this,
|
|
208
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_isNumber, "f");
|
|
202
209
|
}
|
|
203
210
|
get isPrimeNumber() {
|
|
204
|
-
return __classPrivateFieldGet(this,
|
|
211
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_isPrimeNumber, "f");
|
|
205
212
|
}
|
|
206
213
|
get lcm() {
|
|
207
|
-
return __classPrivateFieldGet(this,
|
|
214
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_lcm, "f");
|
|
208
215
|
}
|
|
209
216
|
get mathConverter() {
|
|
210
|
-
return __classPrivateFieldGet(this,
|
|
217
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_mathConverter, "f");
|
|
211
218
|
}
|
|
212
219
|
get mathSeparator() {
|
|
213
|
-
return __classPrivateFieldGet(this,
|
|
220
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_mathSeparator, "f");
|
|
214
221
|
}
|
|
215
222
|
get max() {
|
|
216
|
-
return __classPrivateFieldGet(this,
|
|
223
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_max, "f");
|
|
217
224
|
}
|
|
218
225
|
get min() {
|
|
219
|
-
return __classPrivateFieldGet(this,
|
|
226
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_min, "f");
|
|
220
227
|
}
|
|
221
228
|
get multiples() {
|
|
222
|
-
return __classPrivateFieldGet(this,
|
|
229
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_multiples, "f");
|
|
223
230
|
}
|
|
224
231
|
get multiplication() {
|
|
225
|
-
return __classPrivateFieldGet(this,
|
|
232
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_multiplication, "f");
|
|
226
233
|
}
|
|
227
234
|
get nCr() {
|
|
228
|
-
return __classPrivateFieldGet(this,
|
|
235
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_nCr, "f");
|
|
229
236
|
}
|
|
230
237
|
get nHr() {
|
|
231
|
-
return __classPrivateFieldGet(this,
|
|
238
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_nHr, "f");
|
|
232
239
|
}
|
|
233
240
|
get nPr() {
|
|
234
|
-
return __classPrivateFieldGet(this,
|
|
241
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_nPr, "f");
|
|
235
242
|
}
|
|
236
243
|
get primeFactorization() {
|
|
237
|
-
return __classPrivateFieldGet(this,
|
|
244
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_primeFactorization, "f");
|
|
238
245
|
}
|
|
239
246
|
get quotient() {
|
|
240
|
-
return __classPrivateFieldGet(this,
|
|
247
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_quotient, "f");
|
|
241
248
|
}
|
|
242
249
|
get radToDeg() {
|
|
243
|
-
return __classPrivateFieldGet(this,
|
|
250
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_radToDeg, "f");
|
|
244
251
|
}
|
|
245
252
|
get random() {
|
|
246
|
-
return __classPrivateFieldGet(this,
|
|
253
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_random, "f");
|
|
247
254
|
}
|
|
248
255
|
get reduce() {
|
|
249
|
-
return __classPrivateFieldGet(this,
|
|
256
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_reduce, "f");
|
|
250
257
|
}
|
|
251
258
|
get repeatedTrial() {
|
|
252
|
-
return __classPrivateFieldGet(this,
|
|
259
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_repeatedTrial, "f");
|
|
253
260
|
}
|
|
254
261
|
get roundOf() {
|
|
255
|
-
return __classPrivateFieldGet(this,
|
|
262
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_roundOf, "f");
|
|
256
263
|
}
|
|
257
264
|
get softmax() {
|
|
258
|
-
return __classPrivateFieldGet(this,
|
|
265
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_softmax, "f");
|
|
259
266
|
}
|
|
260
267
|
get standardDeviation() {
|
|
261
|
-
return __classPrivateFieldGet(this,
|
|
268
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_standardDeviation, "f");
|
|
262
269
|
}
|
|
263
270
|
get subtract() {
|
|
264
|
-
return __classPrivateFieldGet(this,
|
|
271
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_subtract, "f");
|
|
265
272
|
}
|
|
266
273
|
get toBinary() {
|
|
267
|
-
return __classPrivateFieldGet(this,
|
|
274
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_toBinary, "f");
|
|
268
275
|
}
|
|
269
276
|
get toCelsius() {
|
|
270
|
-
return __classPrivateFieldGet(this,
|
|
277
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_toCelsius, "f");
|
|
271
278
|
}
|
|
272
279
|
get toKelvin() {
|
|
273
|
-
return __classPrivateFieldGet(this,
|
|
280
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_toKelvin, "f");
|
|
274
281
|
}
|
|
275
282
|
get valueSwap() {
|
|
276
|
-
return __classPrivateFieldGet(this,
|
|
283
|
+
return __classPrivateFieldGet(this, _UMTMathClass_Local_valueSwap, "f");
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
286
|
exports.UMTMathClass = UMTMathClass;
|
|
280
|
-
|
|
287
|
+
_UMTMathClass_Local_addition = new WeakMap(), _UMTMathClass_Local_average = new WeakMap(), _UMTMathClass_Local_calculator = new WeakMap(), _UMTMathClass_Local_calculatorInitialization = new WeakMap(), _UMTMathClass_Local_degToRad = new WeakMap(), _UMTMathClass_Local_deviationValue = new WeakMap(), _UMTMathClass_Local_division = new WeakMap(), _UMTMathClass_Local_factorial = new WeakMap(), _UMTMathClass_Local_factorize = new WeakMap(), _UMTMathClass_Local_gcd = new WeakMap(), _UMTMathClass_Local_getDecimalLength = new WeakMap(), _UMTMathClass_Local_isDouble = new WeakMap(), _UMTMathClass_Local_isNumber = new WeakMap(), _UMTMathClass_Local_isPrimeNumber = new WeakMap(), _UMTMathClass_Local_lcm = new WeakMap(), _UMTMathClass_Local_mathConverter = new WeakMap(), _UMTMathClass_Local_mathSeparator = new WeakMap(), _UMTMathClass_Local_max = new WeakMap(), _UMTMathClass_Local_min = new WeakMap(), _UMTMathClass_Local_multiples = new WeakMap(), _UMTMathClass_Local_multiplication = new WeakMap(), _UMTMathClass_Local_nCr = new WeakMap(), _UMTMathClass_Local_nHr = new WeakMap(), _UMTMathClass_Local_nPr = new WeakMap(), _UMTMathClass_Local_primeFactorization = new WeakMap(), _UMTMathClass_Local_quotient = new WeakMap(), _UMTMathClass_Local_radToDeg = new WeakMap(), _UMTMathClass_Local_random = new WeakMap(), _UMTMathClass_Local_reduce = new WeakMap(), _UMTMathClass_Local_repeatedTrial = new WeakMap(), _UMTMathClass_Local_roundOf = new WeakMap(), _UMTMathClass_Local_softmax = new WeakMap(), _UMTMathClass_Local_standardDeviation = new WeakMap(), _UMTMathClass_Local_subtract = new WeakMap(), _UMTMathClass_Local_toBinary = new WeakMap(), _UMTMathClass_Local_toCelsius = new WeakMap(), _UMTMathClass_Local_toKelvin = new WeakMap(), _UMTMathClass_Local_valueSwap = new WeakMap();
|
|
281
288
|
exports.UMT_Math = new UMTMathClass();
|
package/module/Math/isDouble.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isDouble = void 0;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param
|
|
7
|
-
* @param {boolean} [isStrict=true] - 文字列も対象にするかどうか
|
|
5
|
+
* @param {any} x
|
|
6
|
+
* @param {boolean} [loose=true] - 文字列も対象にするかどうか
|
|
8
7
|
* @returns boolean
|
|
9
8
|
*/
|
|
10
9
|
const isDouble = (x, loose = true) => {
|
package/module/Math/lcm.js
CHANGED
|
@@ -10,10 +10,13 @@ const valueSwap_1 = require("./valueSwap");
|
|
|
10
10
|
* @returns number
|
|
11
11
|
*/
|
|
12
12
|
const lcm = (x, y) => {
|
|
13
|
+
// If either input is 0, the least common multiple is 0
|
|
13
14
|
if (x === 0 || y === 0) {
|
|
14
15
|
return 0;
|
|
15
16
|
}
|
|
17
|
+
// Swap the values of x and y if x is greater than y
|
|
16
18
|
[x, y] = (0, valueSwap_1.valueSwap)(x, y);
|
|
19
|
+
// The least common multiple is x times y divided by their greatest common divisor
|
|
17
20
|
return (x / (0, gcd_1.gcd)(x, y)) * y;
|
|
18
21
|
};
|
|
19
22
|
exports.lcm = lcm;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.roundOf = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* 四捨五入
|
|
6
|
+
* @param {number} num - 四捨五入する数値
|
|
7
|
+
* @param {number} precision - 四捨五入する桁数
|
|
8
|
+
* @returns number
|
|
9
|
+
*/
|
|
10
|
+
const roundOf = (num, precision) => {
|
|
11
|
+
return (Math.round(num * Math.pow(10, precision)) /
|
|
12
|
+
Math.pow(10, precision));
|
|
13
|
+
};
|
|
14
|
+
exports.roundOf = roundOf;
|
package/module/Math/softmax.js
CHANGED
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.softmax = void 0;
|
|
27
27
|
const ArraySum = __importStar(require("../Array/sum"));
|
|
28
28
|
const division_1 = require("./division");
|
|
29
|
-
const
|
|
29
|
+
const roundOf_1 = require("./roundOf");
|
|
30
30
|
/**
|
|
31
31
|
* @param {number[]} x
|
|
32
32
|
* @return {number[]}
|
|
@@ -35,6 +35,6 @@ const softmax = (x) => {
|
|
|
35
35
|
const max = Math.max(...x);
|
|
36
36
|
const exp = x.map((i) => Math.exp(i - max));
|
|
37
37
|
const sum = ArraySum.sum(exp);
|
|
38
|
-
return exp.map((i) => (0,
|
|
38
|
+
return exp.map((i) => (0, roundOf_1.roundOf)((0, division_1.division)(i, sum), 3));
|
|
39
39
|
};
|
|
40
40
|
exports.softmax = softmax;
|
package/module/Math/subtract.js
CHANGED
|
@@ -10,9 +10,15 @@ const multiplication_1 = require("./multiplication");
|
|
|
10
10
|
* @param {number} y
|
|
11
11
|
*/
|
|
12
12
|
const subtract = (x, y) => {
|
|
13
|
+
if (isNaN(x) || isNaN(y)) {
|
|
14
|
+
throw new Error('x または y が数値ではありません。');
|
|
15
|
+
}
|
|
16
|
+
if (!isFinite(x) || !isFinite(y)) {
|
|
17
|
+
throw new Error('x または y が有限ではありません。');
|
|
18
|
+
}
|
|
19
|
+
// 10の何乗かを取得
|
|
13
20
|
const z = Math.pow(10, (0, max_1.max)((0, getDecimalLength_1.getDecimalLength)(x), (0, getDecimalLength_1.getDecimalLength)(y)));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
z);
|
|
21
|
+
// 小数点を揃えてから引き算
|
|
22
|
+
return ((0, multiplication_1.multiplication)(x, z) - (0, multiplication_1.multiplication)(y, z)) / z;
|
|
17
23
|
};
|
|
18
24
|
exports.subtract = subtract;
|
package/module/Math/toCelsius.js
CHANGED
|
@@ -2,5 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toCelsius = void 0;
|
|
4
4
|
const subtract_1 = require("./subtract");
|
|
5
|
+
/**
|
|
6
|
+
* Converts a temperature from Kelvin to Celsius.
|
|
7
|
+
* @param kelvin The temperature in Kelvin.
|
|
8
|
+
* @returns The temperature in Celsius.
|
|
9
|
+
*/
|
|
5
10
|
const toCelsius = (kelvin) => (0, subtract_1.subtract)(kelvin, 273.15);
|
|
6
11
|
exports.toCelsius = toCelsius;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* x < yになるように入れ替える
|
|
3
3
|
* @param {number} x
|
|
4
4
|
* @param {number} y
|
|
5
|
-
* @return {number
|
|
5
|
+
* @return {[number, number]}
|
|
6
6
|
*/
|
|
7
|
-
export declare const valueSwap: (x: number, y: number) => number
|
|
7
|
+
export declare const valueSwap: (x: number, y: number) => [number, number];
|
package/module/Math/valueSwap.js
CHANGED
|
@@ -10,18 +10,18 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
13
|
+
var _UMTSimpleDateClass_Local_now;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.UMTSimpleDateClass = void 0;
|
|
16
16
|
const now_1 = require("./now");
|
|
17
17
|
class UMTSimpleDateClass {
|
|
18
18
|
constructor() {
|
|
19
|
-
|
|
20
|
-
__classPrivateFieldSet(this,
|
|
19
|
+
_UMTSimpleDateClass_Local_now.set(this, void 0);
|
|
20
|
+
__classPrivateFieldSet(this, _UMTSimpleDateClass_Local_now, now_1.nowSimple, "f");
|
|
21
21
|
}
|
|
22
22
|
get now() {
|
|
23
|
-
return __classPrivateFieldGet(this,
|
|
23
|
+
return __classPrivateFieldGet(this, _UMTSimpleDateClass_Local_now, "f");
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
exports.UMTSimpleDateClass = UMTSimpleDateClass;
|
|
27
|
-
|
|
27
|
+
_UMTSimpleDateClass_Local_now = new WeakMap();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dayType, MonthsWihout31Days, MonthsWith31Days } from '../../types/monType';
|
|
2
2
|
export declare const dayOfWeekSimple: <T extends MonthsWith31Days | MonthsWihout31Days>(props?: Date | {
|
|
3
3
|
yer?: number | undefined;
|
|
4
|
-
mon?:
|
|
5
|
-
day?:
|
|
4
|
+
mon?: T | undefined;
|
|
5
|
+
day?: dayType<T> | undefined;
|
|
6
6
|
} | `${number}-${T}-${dayType<T>}` | `${number}:${T}:${dayType<T>}` | `${number}/${T}/${dayType<T>}` | undefined, timeDifference?: number) => number;
|
|
@@ -5,15 +5,21 @@ const dayOfWeek_1 = require("../../Tool/dayOfWeek");
|
|
|
5
5
|
const dayOfWeekSimple = (props, timeDifference = 9) => {
|
|
6
6
|
if (typeof props === 'string') {
|
|
7
7
|
if (props.includes(':')) {
|
|
8
|
-
const [yer, mon, day] = props
|
|
8
|
+
const [yer, mon, day] = props
|
|
9
|
+
.split(':')
|
|
10
|
+
.map(Number);
|
|
9
11
|
return (0, dayOfWeek_1.dayOfWeek)({ yer, mon, day }, timeDifference);
|
|
10
12
|
}
|
|
11
13
|
else if (props.includes('/')) {
|
|
12
|
-
const [yer, mon, day] = props
|
|
14
|
+
const [yer, mon, day] = props
|
|
15
|
+
.split('/')
|
|
16
|
+
.map(Number);
|
|
13
17
|
return (0, dayOfWeek_1.dayOfWeek)({ yer, mon, day }, timeDifference);
|
|
14
18
|
}
|
|
15
19
|
else {
|
|
16
|
-
const [yer, mon, day] = props
|
|
20
|
+
const [yer, mon, day] = props
|
|
21
|
+
.split('-')
|
|
22
|
+
.map(Number);
|
|
17
23
|
return (0, dayOfWeek_1.dayOfWeek)({ yer, mon, day }, timeDifference);
|
|
18
24
|
}
|
|
19
25
|
}
|
|
@@ -3,8 +3,8 @@ export declare class UMTSimpleMathClass {
|
|
|
3
3
|
constructor();
|
|
4
4
|
get dayOfWeek(): <T extends import("../../types/monType").MonthsWith31Days | import("../../types/monType").MonthsWihout31Days>(props?: Date | {
|
|
5
5
|
yer?: number | undefined;
|
|
6
|
-
mon?:
|
|
7
|
-
day?:
|
|
6
|
+
mon?: T | undefined;
|
|
7
|
+
day?: import("../../types/monType").dayType<T> | undefined;
|
|
8
8
|
} | `${number}-${T}-${import("../../types/monType").dayType<T>}` | `${number}:${T}:${import("../../types/monType").dayType<T>}` | `${number}/${T}/${import("../../types/monType").dayType<T>}` | undefined, timeDifference?: number) => number;
|
|
9
9
|
get deviationValue(): import("./deviationValue").DeviationValueSimple;
|
|
10
10
|
}
|
|
@@ -10,24 +10,24 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
13
|
+
var _UMTSimpleMathClass_Local_dayOfWeek, _UMTSimpleMathClass_Local_deviationValue;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.UMTSimpleMathClass = void 0;
|
|
16
16
|
const dayOfWeek_1 = require("./dayOfWeek");
|
|
17
17
|
const deviationValue_1 = require("./deviationValue");
|
|
18
18
|
class UMTSimpleMathClass {
|
|
19
19
|
constructor() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__classPrivateFieldSet(this,
|
|
23
|
-
__classPrivateFieldSet(this,
|
|
20
|
+
_UMTSimpleMathClass_Local_dayOfWeek.set(this, void 0);
|
|
21
|
+
_UMTSimpleMathClass_Local_deviationValue.set(this, void 0);
|
|
22
|
+
__classPrivateFieldSet(this, _UMTSimpleMathClass_Local_dayOfWeek, dayOfWeek_1.dayOfWeekSimple, "f");
|
|
23
|
+
__classPrivateFieldSet(this, _UMTSimpleMathClass_Local_deviationValue, deviationValue_1.deviationValueSimple, "f");
|
|
24
24
|
}
|
|
25
25
|
get dayOfWeek() {
|
|
26
|
-
return __classPrivateFieldGet(this,
|
|
26
|
+
return __classPrivateFieldGet(this, _UMTSimpleMathClass_Local_dayOfWeek, "f");
|
|
27
27
|
}
|
|
28
28
|
get deviationValue() {
|
|
29
|
-
return __classPrivateFieldGet(this,
|
|
29
|
+
return __classPrivateFieldGet(this, _UMTSimpleMathClass_Local_deviationValue, "f");
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
exports.UMTSimpleMathClass = UMTSimpleMathClass;
|
|
33
|
-
|
|
33
|
+
_UMTSimpleMathClass_Local_dayOfWeek = new WeakMap(), _UMTSimpleMathClass_Local_deviationValue = new WeakMap();
|