umt 1.0.15 → 1.1.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/module/Array/arraysJoin.js +1 -10
- package/module/Array/getArraysCommon.d.ts +1 -1
- package/module/Array/getArraysCommon.js +1 -14
- package/module/Array/getArraysDiff.d.ts +3 -3
- package/module/Array/getArraysDiff.js +2 -2
- package/module/Array/index.d.ts +7 -3
- package/module/Array/index.js +10 -28
- package/module/Array/quickSort.js +3 -1
- package/module/Date/DateWrapper.d.ts +4 -0
- package/module/Date/DateWrapper.js +11 -0
- package/module/Date/index.d.ts +8 -3
- package/module/Date/index.js +14 -17
- package/module/Date/new.d.ts +4 -0
- package/module/Date/new.js +12 -0
- package/module/Date/now.d.ts +1 -1
- package/module/Date/now.js +13 -5
- package/module/Math/calculator/core.js +37 -40
- package/module/Math/calculator/exchange.js +2 -2
- package/module/Math/calculator/index.js +5 -4
- package/module/Math/calculator/literalExpression.js +4 -4
- package/module/Math/division.js +13 -9
- package/module/Math/factorial.js +5 -4
- package/module/Math/factorize.js +4 -3
- package/module/Math/gcd.js +14 -10
- package/module/Math/getDecimalLength.js +1 -1
- package/module/Math/index.d.ts +79 -40
- package/module/Math/index.js +81 -125
- package/module/Math/isDouble.js +3 -2
- package/module/Math/isNumber.js +3 -2
- package/module/Math/isPrimeNumber.js +28 -6
- package/module/Math/lcm.js +5 -3
- package/module/Math/mathConverter.js +16 -17
- package/module/Math/multiples.js +1 -1
- package/module/Math/multiplication.js +5 -3
- package/module/Math/nCr.js +2 -1
- package/module/Math/nHr.js +2 -1
- package/module/Math/nPr.js +14 -11
- package/module/Math/primeFactorization.js +5 -4
- package/module/Math/random.d.ts +2 -2
- package/module/Math/random.js +2 -2
- package/module/Math/reduce.js +1 -1
- package/module/Math/repeatedTrial.js +4 -4
- package/module/Math/solveEquation.d.ts +18 -0
- package/module/Math/solveEquation.js +72 -0
- package/module/Math/subtract.js +0 -6
- package/module/Math/valueSwap.js +7 -5
- package/module/Object/index.d.ts +12 -0
- package/module/Object/index.js +15 -0
- package/module/Object/objectUnion.d.ts +5 -0
- package/module/Object/objectUnion.js +7 -0
- package/module/Simple/Date/index.d.ts +1 -1
- package/module/Simple/Date/index.js +2 -16
- package/module/Simple/Date/now.js +7 -7
- package/module/Simple/Tool/birthday.d.ts +1 -1
- package/module/Simple/Tool/birthday.js +6 -6
- package/module/Simple/Tool/dayOfWeekSimple.d.ts +2 -2
- package/module/Simple/Tool/dayOfWeekSimple.js +9 -6
- package/module/Simple/Tool/deviationValueSimple.js +4 -3
- package/module/Simple/Tool/index.d.ts +6 -4
- package/module/Simple/Tool/index.js +6 -22
- package/module/Simple/index.d.ts +4 -3
- package/module/Simple/index.js +6 -21
- package/module/String/index.d.ts +8 -0
- package/module/String/index.js +15 -0
- package/module/String/reverseString.d.ts +1 -0
- package/module/String/reverseString.js +7 -0
- package/module/Tool/birthday.js +1 -2
- package/module/Tool/dayOfWeek.d.ts +1 -1
- package/module/Tool/dayOfWeek.js +2 -2
- package/module/Tool/index.d.ts +8 -3
- package/module/Tool/index.js +12 -31
- package/module/Tool/isBrowser.js +1 -1
- package/module/index.d.ts +14 -6
- package/module/index.js +25 -33
- package/module/tsconfig.tsbuildinfo +1 -1
- package/module/types/clockType.d.ts +9 -0
- package/module/types/dateType.d.ts +11 -0
- package/module/types/dateType.js +2 -0
- package/module/types/int.d.ts +4 -4
- package/module/types/logicType.d.ts +9 -8
- package/package.json +16 -8
- package/.markdownlint.json +0 -6
- package/.nvmrc +0 -1
- package/jest.config.js +0 -16
- package/make_test.py +0 -24
- package/module/Math/softmax.d.ts +0 -5
- package/module/Math/softmax.js +0 -40
- package/module/types/monType.d.ts +0 -8
- /package/module/types/{monType.js → clockType.js} +0 -0
package/module/Math/index.d.ts
CHANGED
|
@@ -1,43 +1,81 @@
|
|
|
1
|
-
import { addition } from
|
|
2
|
-
import { average } from
|
|
3
|
-
import { calculator } from
|
|
4
|
-
import { calculatorInitialization } from
|
|
5
|
-
import { degToRad } from
|
|
6
|
-
import { deviationValue } from
|
|
7
|
-
import { division } from
|
|
8
|
-
import { factorial } from
|
|
9
|
-
import { factorize } from
|
|
10
|
-
import { gcd } from
|
|
11
|
-
import { getDecimalLength } from
|
|
12
|
-
import { isDouble } from
|
|
13
|
-
import { isNumber } from
|
|
14
|
-
import { isPrimeNumber } from
|
|
15
|
-
import { lcm } from
|
|
16
|
-
import { mathConverter } from
|
|
17
|
-
import { mathSeparator } from
|
|
18
|
-
import { max } from
|
|
19
|
-
import { min } from
|
|
20
|
-
import { multiples } from
|
|
21
|
-
import { multiplication } from
|
|
22
|
-
import { nCr } from
|
|
23
|
-
import { nHr } from
|
|
24
|
-
import { nPr } from
|
|
25
|
-
import { primeFactorization } from
|
|
26
|
-
import { quotient } from
|
|
27
|
-
import { radToDeg } from
|
|
28
|
-
import { random } from
|
|
29
|
-
import { reduce } from
|
|
30
|
-
import { repeatedTrial } from
|
|
31
|
-
import { roundOf } from
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
|
|
1
|
+
import { addition } from "./addition";
|
|
2
|
+
import { average } from "./average";
|
|
3
|
+
import { calculator } from "./calculator";
|
|
4
|
+
import { calculatorInitialization } from "./calculator/calculatorInitialization";
|
|
5
|
+
import { degToRad } from "./degToRad";
|
|
6
|
+
import { deviationValue } from "./deviationValue";
|
|
7
|
+
import { division } from "./division";
|
|
8
|
+
import { factorial } from "./factorial";
|
|
9
|
+
import { factorize } from "./factorize";
|
|
10
|
+
import { gcd } from "./gcd";
|
|
11
|
+
import { getDecimalLength } from "./getDecimalLength";
|
|
12
|
+
import { isDouble } from "./isDouble";
|
|
13
|
+
import { isNumber } from "./isNumber";
|
|
14
|
+
import { isPrimeNumber } from "./isPrimeNumber";
|
|
15
|
+
import { lcm } from "./lcm";
|
|
16
|
+
import { mathConverter } from "./mathConverter";
|
|
17
|
+
import { mathSeparator } from "./mathSeparator";
|
|
18
|
+
import { max } from "./max";
|
|
19
|
+
import { min } from "./min";
|
|
20
|
+
import { multiples } from "./multiples";
|
|
21
|
+
import { multiplication } from "./multiplication";
|
|
22
|
+
import { nCr } from "./nCr";
|
|
23
|
+
import { nHr } from "./nHr";
|
|
24
|
+
import { nPr } from "./nPr";
|
|
25
|
+
import { primeFactorization } from "./primeFactorization";
|
|
26
|
+
import { quotient } from "./quotient";
|
|
27
|
+
import { radToDeg } from "./radToDeg";
|
|
28
|
+
import { random } from "./random";
|
|
29
|
+
import { reduce } from "./reduce";
|
|
30
|
+
import { repeatedTrial } from "./repeatedTrial";
|
|
31
|
+
import { roundOf } from "./roundOf";
|
|
32
|
+
import { solveEquation } from "./solveEquation";
|
|
33
|
+
import { standardDeviation } from "./standardDeviation";
|
|
34
|
+
import { subtract } from "./subtract";
|
|
35
|
+
import { toBinary } from "./toBinary";
|
|
36
|
+
import { toCelsius } from "./toCelsius";
|
|
37
|
+
import { toKelvin } from "./toKelvin";
|
|
38
|
+
import { valueSwap } from "./valueSwap";
|
|
39
|
+
export { addition, average, calculator, calculatorInitialization, degToRad, deviationValue, division, factorial, factorize, gcd, getDecimalLength, isDouble, isNumber, isPrimeNumber, lcm, mathConverter, mathSeparator, max, min, multiples, multiplication, nCr, nHr, nPr, primeFactorization, quotient, radToDeg, random, reduce, repeatedTrial, roundOf, solveEquation, standardDeviation, subtract, toBinary, toCelsius, toKelvin, valueSwap, };
|
|
39
40
|
export declare class UMTMathClass {
|
|
40
|
-
|
|
41
|
+
private localAddition;
|
|
42
|
+
private localAverage;
|
|
43
|
+
private localCalculator;
|
|
44
|
+
private localCalculatorInitialization;
|
|
45
|
+
private localDegToRad;
|
|
46
|
+
private localDeviationValue;
|
|
47
|
+
private localDivision;
|
|
48
|
+
private localFactorial;
|
|
49
|
+
private localFactorize;
|
|
50
|
+
private localGcd;
|
|
51
|
+
private localGetDecimalLength;
|
|
52
|
+
private localIsDouble;
|
|
53
|
+
private localIsNumber;
|
|
54
|
+
private localIsPrimeNumber;
|
|
55
|
+
private localLcm;
|
|
56
|
+
private localMathConverter;
|
|
57
|
+
private localMathSeparator;
|
|
58
|
+
private localMax;
|
|
59
|
+
private localMin;
|
|
60
|
+
private localMultiples;
|
|
61
|
+
private localMultiplication;
|
|
62
|
+
private localNCr;
|
|
63
|
+
private localNHr;
|
|
64
|
+
private localNPr;
|
|
65
|
+
private localPrimeFactorization;
|
|
66
|
+
private localQuotient;
|
|
67
|
+
private localRadToDeg;
|
|
68
|
+
private localRandom;
|
|
69
|
+
private localReduce;
|
|
70
|
+
private localRepeatedTrial;
|
|
71
|
+
private localRoundOf;
|
|
72
|
+
private localSolveEquation;
|
|
73
|
+
private localStandardDeviation;
|
|
74
|
+
private localSubtract;
|
|
75
|
+
private localToBinary;
|
|
76
|
+
private localToCelsius;
|
|
77
|
+
private localToKelvin;
|
|
78
|
+
private localValueSwap;
|
|
41
79
|
constructor();
|
|
42
80
|
get addition(): (x: number, y: number) => number;
|
|
43
81
|
get average(): (numbers: number[]) => number;
|
|
@@ -69,7 +107,7 @@ export declare class UMTMathClass {
|
|
|
69
107
|
}[];
|
|
70
108
|
get quotient(): (x: number, y: number) => number[];
|
|
71
109
|
get radToDeg(): (x: number) => number;
|
|
72
|
-
get random(): (
|
|
110
|
+
get random(): (max: number, min?: number) => number;
|
|
73
111
|
get reduce(): (x: number, y: number) => {
|
|
74
112
|
x: number;
|
|
75
113
|
y: number;
|
|
@@ -84,6 +122,7 @@ export declare class UMTMathClass {
|
|
|
84
122
|
y: number;
|
|
85
123
|
}) => number[];
|
|
86
124
|
get roundOf(): (num: number, precision: number) => number;
|
|
125
|
+
get solveEquation(): (coefficients: number[][], constants: number[]) => number[];
|
|
87
126
|
get standardDeviation(): (values: number[]) => number;
|
|
88
127
|
get subtract(): (x: number, y: number) => number;
|
|
89
128
|
get toBinary(): import("./toBinary").TOBINARY;
|
package/module/Math/index.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
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_standardDeviation, _UMTMathClass_Local_subtract, _UMTMathClass_Local_toBinary, _UMTMathClass_Local_toCelsius, _UMTMathClass_Local_toKelvin, _UMTMathClass_Local_valueSwap;
|
|
14
2
|
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.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;
|
|
3
|
+
exports.UMT_Math = exports.UMTMathClass = exports.valueSwap = exports.toKelvin = exports.toCelsius = exports.toBinary = exports.subtract = exports.standardDeviation = exports.solveEquation = 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
4
|
const addition_1 = require("./addition");
|
|
17
5
|
Object.defineProperty(exports, "addition", { enumerable: true, get: function () { return addition_1.addition; } });
|
|
18
6
|
const average_1 = require("./average");
|
|
@@ -75,6 +63,8 @@ const repeatedTrial_1 = require("./repeatedTrial");
|
|
|
75
63
|
Object.defineProperty(exports, "repeatedTrial", { enumerable: true, get: function () { return repeatedTrial_1.repeatedTrial; } });
|
|
76
64
|
const roundOf_1 = require("./roundOf");
|
|
77
65
|
Object.defineProperty(exports, "roundOf", { enumerable: true, get: function () { return roundOf_1.roundOf; } });
|
|
66
|
+
const solveEquation_1 = require("./solveEquation");
|
|
67
|
+
Object.defineProperty(exports, "solveEquation", { enumerable: true, get: function () { return solveEquation_1.solveEquation; } });
|
|
78
68
|
const standardDeviation_1 = require("./standardDeviation");
|
|
79
69
|
Object.defineProperty(exports, "standardDeviation", { enumerable: true, get: function () { return standardDeviation_1.standardDeviation; } });
|
|
80
70
|
const subtract_1 = require("./subtract");
|
|
@@ -89,193 +79,159 @@ const valueSwap_1 = require("./valueSwap");
|
|
|
89
79
|
Object.defineProperty(exports, "valueSwap", { enumerable: true, get: function () { return valueSwap_1.valueSwap; } });
|
|
90
80
|
class UMTMathClass {
|
|
91
81
|
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, _UMTMathClass_Local_average, average_1.average, "f");
|
|
131
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_calculator, calculator_1.calculator, "f");
|
|
132
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_calculatorInitialization, calculatorInitialization_1.calculatorInitialization, "f");
|
|
133
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_degToRad, degToRad_1.degToRad, "f");
|
|
134
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_deviationValue, deviationValue_1.deviationValue, "f");
|
|
135
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_division, division_1.division, "f");
|
|
136
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_factorial, factorial_1.factorial, "f");
|
|
137
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_factorize, factorize_1.factorize, "f");
|
|
138
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_gcd, gcd_1.gcd, "f");
|
|
139
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_getDecimalLength, getDecimalLength_1.getDecimalLength, "f");
|
|
140
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_isDouble, isDouble_1.isDouble, "f");
|
|
141
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_isNumber, isNumber_1.isNumber, "f");
|
|
142
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_isPrimeNumber, isPrimeNumber_1.isPrimeNumber, "f");
|
|
143
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_lcm, lcm_1.lcm, "f");
|
|
144
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_mathConverter, mathConverter_1.mathConverter, "f");
|
|
145
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_mathSeparator, mathSeparator_1.mathSeparator, "f");
|
|
146
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_max, max_1.max, "f");
|
|
147
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_min, min_1.min, "f");
|
|
148
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_multiples, multiples_1.multiples, "f");
|
|
149
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_multiplication, multiplication_1.multiplication, "f");
|
|
150
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_nCr, nCr_1.nCr, "f");
|
|
151
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_nHr, nHr_1.nHr, "f");
|
|
152
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_nPr, nPr_1.nPr, "f");
|
|
153
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_primeFactorization, primeFactorization_1.primeFactorization, "f");
|
|
154
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_quotient, quotient_1.quotient, "f");
|
|
155
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_radToDeg, radToDeg_1.radToDeg, "f");
|
|
156
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_random, random_1.random, "f");
|
|
157
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_reduce, reduce_1.reduce, "f");
|
|
158
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_repeatedTrial, repeatedTrial_1.repeatedTrial, "f");
|
|
159
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_roundOf, roundOf_1.roundOf, "f");
|
|
160
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_standardDeviation, standardDeviation_1.standardDeviation, "f");
|
|
161
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_subtract, subtract_1.subtract, "f");
|
|
162
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_toBinary, toBinary_1.toBinary, "f");
|
|
163
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_toCelsius, toCelsius_1.toCelsius, "f");
|
|
164
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_toKelvin, toKelvin_1.toKelvin, "f");
|
|
165
|
-
__classPrivateFieldSet(this, _UMTMathClass_Local_valueSwap, valueSwap_1.valueSwap, "f");
|
|
82
|
+
this.localAddition = addition_1.addition;
|
|
83
|
+
this.localAverage = average_1.average;
|
|
84
|
+
this.localCalculator = calculator_1.calculator;
|
|
85
|
+
this.localCalculatorInitialization = calculatorInitialization_1.calculatorInitialization;
|
|
86
|
+
this.localDegToRad = degToRad_1.degToRad;
|
|
87
|
+
this.localDeviationValue = deviationValue_1.deviationValue;
|
|
88
|
+
this.localDivision = division_1.division;
|
|
89
|
+
this.localFactorial = factorial_1.factorial;
|
|
90
|
+
this.localFactorize = factorize_1.factorize;
|
|
91
|
+
this.localGcd = gcd_1.gcd;
|
|
92
|
+
this.localGetDecimalLength = getDecimalLength_1.getDecimalLength;
|
|
93
|
+
this.localIsDouble = isDouble_1.isDouble;
|
|
94
|
+
this.localIsNumber = isNumber_1.isNumber;
|
|
95
|
+
this.localIsPrimeNumber = isPrimeNumber_1.isPrimeNumber;
|
|
96
|
+
this.localLcm = lcm_1.lcm;
|
|
97
|
+
this.localMathConverter = mathConverter_1.mathConverter;
|
|
98
|
+
this.localMathSeparator = mathSeparator_1.mathSeparator;
|
|
99
|
+
this.localMax = max_1.max;
|
|
100
|
+
this.localMin = min_1.min;
|
|
101
|
+
this.localMultiples = multiples_1.multiples;
|
|
102
|
+
this.localMultiplication = multiplication_1.multiplication;
|
|
103
|
+
this.localNCr = nCr_1.nCr;
|
|
104
|
+
this.localNHr = nHr_1.nHr;
|
|
105
|
+
this.localNPr = nPr_1.nPr;
|
|
106
|
+
this.localPrimeFactorization = primeFactorization_1.primeFactorization;
|
|
107
|
+
this.localQuotient = quotient_1.quotient;
|
|
108
|
+
this.localRadToDeg = radToDeg_1.radToDeg;
|
|
109
|
+
this.localRandom = random_1.random;
|
|
110
|
+
this.localReduce = reduce_1.reduce;
|
|
111
|
+
this.localRepeatedTrial = repeatedTrial_1.repeatedTrial;
|
|
112
|
+
this.localRoundOf = roundOf_1.roundOf;
|
|
113
|
+
this.localSolveEquation = solveEquation_1.solveEquation;
|
|
114
|
+
this.localStandardDeviation = standardDeviation_1.standardDeviation;
|
|
115
|
+
this.localSubtract = subtract_1.subtract;
|
|
116
|
+
this.localToBinary = toBinary_1.toBinary;
|
|
117
|
+
this.localToCelsius = toCelsius_1.toCelsius;
|
|
118
|
+
this.localToKelvin = toKelvin_1.toKelvin;
|
|
119
|
+
this.localValueSwap = valueSwap_1.valueSwap;
|
|
166
120
|
}
|
|
167
121
|
get addition() {
|
|
168
|
-
return
|
|
122
|
+
return this.localAddition;
|
|
169
123
|
}
|
|
170
124
|
get average() {
|
|
171
|
-
return
|
|
125
|
+
return this.localAverage;
|
|
172
126
|
}
|
|
173
127
|
get calculator() {
|
|
174
|
-
return
|
|
128
|
+
return this.localCalculator;
|
|
175
129
|
}
|
|
176
130
|
get calculatorInitialization() {
|
|
177
|
-
return
|
|
131
|
+
return this.localCalculatorInitialization;
|
|
178
132
|
}
|
|
179
133
|
get degToRad() {
|
|
180
|
-
return
|
|
134
|
+
return this.localDegToRad;
|
|
181
135
|
}
|
|
182
136
|
get deviationValue() {
|
|
183
|
-
return
|
|
137
|
+
return this.localDeviationValue;
|
|
184
138
|
}
|
|
185
139
|
get division() {
|
|
186
|
-
return
|
|
140
|
+
return this.localDivision;
|
|
187
141
|
}
|
|
188
142
|
get factorial() {
|
|
189
|
-
return
|
|
143
|
+
return this.localFactorial;
|
|
190
144
|
}
|
|
191
145
|
get factorize() {
|
|
192
|
-
return
|
|
146
|
+
return this.localFactorize;
|
|
193
147
|
}
|
|
194
148
|
get gcd() {
|
|
195
|
-
return
|
|
149
|
+
return this.localGcd;
|
|
196
150
|
}
|
|
197
151
|
get getDecimalLength() {
|
|
198
|
-
return
|
|
152
|
+
return this.localGetDecimalLength;
|
|
199
153
|
}
|
|
200
154
|
get isDouble() {
|
|
201
|
-
return
|
|
155
|
+
return this.localIsDouble;
|
|
202
156
|
}
|
|
203
157
|
get isNumber() {
|
|
204
|
-
return
|
|
158
|
+
return this.localIsNumber;
|
|
205
159
|
}
|
|
206
160
|
get isPrimeNumber() {
|
|
207
|
-
return
|
|
161
|
+
return this.localIsPrimeNumber;
|
|
208
162
|
}
|
|
209
163
|
get lcm() {
|
|
210
|
-
return
|
|
164
|
+
return this.localLcm;
|
|
211
165
|
}
|
|
212
166
|
get mathConverter() {
|
|
213
|
-
return
|
|
167
|
+
return this.localMathConverter;
|
|
214
168
|
}
|
|
215
169
|
get mathSeparator() {
|
|
216
|
-
return
|
|
170
|
+
return this.localMathSeparator;
|
|
217
171
|
}
|
|
218
172
|
get max() {
|
|
219
|
-
return
|
|
173
|
+
return this.localMax;
|
|
220
174
|
}
|
|
221
175
|
get min() {
|
|
222
|
-
return
|
|
176
|
+
return this.localMin;
|
|
223
177
|
}
|
|
224
178
|
get multiples() {
|
|
225
|
-
return
|
|
179
|
+
return this.localMultiples;
|
|
226
180
|
}
|
|
227
181
|
get multiplication() {
|
|
228
|
-
return
|
|
182
|
+
return this.localMultiplication;
|
|
229
183
|
}
|
|
230
184
|
get nCr() {
|
|
231
|
-
return
|
|
185
|
+
return this.localNCr;
|
|
232
186
|
}
|
|
233
187
|
get nHr() {
|
|
234
|
-
return
|
|
188
|
+
return this.localNHr;
|
|
235
189
|
}
|
|
236
190
|
get nPr() {
|
|
237
|
-
return
|
|
191
|
+
return this.localNPr;
|
|
238
192
|
}
|
|
239
193
|
get primeFactorization() {
|
|
240
|
-
return
|
|
194
|
+
return this.localPrimeFactorization;
|
|
241
195
|
}
|
|
242
196
|
get quotient() {
|
|
243
|
-
return
|
|
197
|
+
return this.localQuotient;
|
|
244
198
|
}
|
|
245
199
|
get radToDeg() {
|
|
246
|
-
return
|
|
200
|
+
return this.localRadToDeg;
|
|
247
201
|
}
|
|
248
202
|
get random() {
|
|
249
|
-
return
|
|
203
|
+
return this.localRandom;
|
|
250
204
|
}
|
|
251
205
|
get reduce() {
|
|
252
|
-
return
|
|
206
|
+
return this.localReduce;
|
|
253
207
|
}
|
|
254
208
|
get repeatedTrial() {
|
|
255
|
-
return
|
|
209
|
+
return this.localRepeatedTrial;
|
|
256
210
|
}
|
|
257
211
|
get roundOf() {
|
|
258
|
-
return
|
|
212
|
+
return this.localRoundOf;
|
|
213
|
+
}
|
|
214
|
+
get solveEquation() {
|
|
215
|
+
return this.localSolveEquation;
|
|
259
216
|
}
|
|
260
217
|
get standardDeviation() {
|
|
261
|
-
return
|
|
218
|
+
return this.localStandardDeviation;
|
|
262
219
|
}
|
|
263
220
|
get subtract() {
|
|
264
|
-
return
|
|
221
|
+
return this.localSubtract;
|
|
265
222
|
}
|
|
266
223
|
get toBinary() {
|
|
267
|
-
return
|
|
224
|
+
return this.localToBinary;
|
|
268
225
|
}
|
|
269
226
|
get toCelsius() {
|
|
270
|
-
return
|
|
227
|
+
return this.localToCelsius;
|
|
271
228
|
}
|
|
272
229
|
get toKelvin() {
|
|
273
|
-
return
|
|
230
|
+
return this.localToKelvin;
|
|
274
231
|
}
|
|
275
232
|
get valueSwap() {
|
|
276
|
-
return
|
|
233
|
+
return this.localValueSwap;
|
|
277
234
|
}
|
|
278
235
|
}
|
|
279
236
|
exports.UMTMathClass = UMTMathClass;
|
|
280
|
-
_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_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
237
|
exports.UMT_Math = new UMTMathClass();
|
package/module/Math/isDouble.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDouble = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @param {any} x
|
|
6
4
|
* @param {boolean} [loose=true] - 文字列も対象にするかどうか
|
|
7
5
|
* @returns boolean
|
|
8
6
|
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.isDouble = void 0;
|
|
9
|
+
// rome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
9
10
|
const isDouble = (x, loose = true) => {
|
|
10
11
|
if (loose) {
|
|
11
12
|
return (isFinite(x) &&
|
package/module/Math/isNumber.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNumber = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* 数字かどうか
|
|
6
4
|
* @param {any} x
|
|
7
5
|
* @param {boolean} loose 文字列も対象にするかどうか
|
|
8
6
|
* @returns boolean
|
|
9
7
|
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.isNumber = void 0;
|
|
10
|
+
// rome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
10
11
|
const isNumber = (x, loose = true) => {
|
|
11
12
|
return x !== null && typeof x !== 'boolean' && loose
|
|
12
13
|
? isFinite(x)
|
|
@@ -2,21 +2,43 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isPrimeNumber = void 0;
|
|
4
4
|
const division_1 = require("./division");
|
|
5
|
+
const multiplication_1 = require("./multiplication");
|
|
5
6
|
/**
|
|
6
7
|
* 素数判定
|
|
7
8
|
* @param {number} n
|
|
8
9
|
* @returns boolean
|
|
9
10
|
*/
|
|
10
11
|
const isPrimeNumber = (n) => {
|
|
11
|
-
|
|
12
|
+
// Check for trivial cases
|
|
13
|
+
if (n <= 1) {
|
|
12
14
|
return false;
|
|
13
|
-
|
|
15
|
+
}
|
|
16
|
+
else if (n <= 3) {
|
|
14
17
|
return true;
|
|
15
|
-
|
|
18
|
+
}
|
|
19
|
+
else if (n % 2 === 0 || n % 3 === 0) {
|
|
16
20
|
return false;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
}
|
|
22
|
+
// Perform Miller-Rabin primality test
|
|
23
|
+
const s = Math.floor(Math.log2(n - 1));
|
|
24
|
+
const d = (n - 1) / Math.pow(2, s);
|
|
25
|
+
for (let i = 0; i < 10; i++) {
|
|
26
|
+
const a = Math.floor(Math.random() * (n - 2)) + 2;
|
|
27
|
+
// let x = BigInt(a) ** BigInt(d) % BigInt(n);
|
|
28
|
+
let x = (0, division_1.division)((0, multiplication_1.multiplication)(a, d), n, false)[1];
|
|
29
|
+
if (x !== 1 && x !== n - 1) {
|
|
30
|
+
for (let j = 0; j < s - 1; j++) {
|
|
31
|
+
x = (0, division_1.division)((0, multiplication_1.multiplication)(x, x), n, false)[1];
|
|
32
|
+
if (x === 1) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
if (x === n - 1) {
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (x !== n - 1) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
20
42
|
}
|
|
21
43
|
}
|
|
22
44
|
return true;
|
package/module/Math/lcm.js
CHANGED
|
@@ -10,13 +10,15 @@ const valueSwap_1 = require("./valueSwap");
|
|
|
10
10
|
* @returns number
|
|
11
11
|
*/
|
|
12
12
|
const lcm = (x, y) => {
|
|
13
|
+
let copyX = x;
|
|
14
|
+
let copyY = y;
|
|
13
15
|
// If either input is 0, the least common multiple is 0
|
|
14
|
-
if (
|
|
16
|
+
if (copyX === 0 || copyY === 0) {
|
|
15
17
|
return 0;
|
|
16
18
|
}
|
|
17
19
|
// Swap the values of x and y if x is greater than y
|
|
18
|
-
[
|
|
20
|
+
[copyX, copyY] = (0, valueSwap_1.valueSwap)(copyX, copyY);
|
|
19
21
|
// The least common multiple is x times y divided by their greatest common divisor
|
|
20
|
-
return (
|
|
22
|
+
return (copyX / (0, gcd_1.gcd)(copyX, copyY)) * copyY;
|
|
21
23
|
};
|
|
22
24
|
exports.lcm = lcm;
|
|
@@ -7,41 +7,40 @@ const mathSeparator_1 = require("./mathSeparator");
|
|
|
7
7
|
* @returns string
|
|
8
8
|
*/
|
|
9
9
|
const mathConverter = (x) => {
|
|
10
|
+
let returnValue = x;
|
|
10
11
|
while (true) {
|
|
11
|
-
if (
|
|
12
|
+
if (returnValue.indexOf("^") !== -1 || returnValue.indexOf("*") !== -1) {
|
|
12
13
|
//掛け算と割り算の処理
|
|
13
14
|
const y = [
|
|
14
|
-
|
|
15
|
-
[
|
|
15
|
+
returnValue.match(/\d+\.?(\d+)?(\*|\^)\d+\.?(\d+)?/),
|
|
16
|
+
[""],
|
|
16
17
|
];
|
|
17
18
|
if (y[0]) {
|
|
18
|
-
y[1] = y[0][0]
|
|
19
|
-
|
|
20
|
-
.filter((n) => {
|
|
21
|
-
return typeof n != 'undefined' && n != '';
|
|
19
|
+
y[1] = y[0][0].split(/(\d+\.\d+)|(\d+)/g).filter((n) => {
|
|
20
|
+
return typeof n !== "undefined" && n !== "";
|
|
22
21
|
});
|
|
23
|
-
if (y[1][0]
|
|
24
|
-
|
|
25
|
-
let [n, m] = (0, mathSeparator_1.mathSeparator)(y[1][0]);
|
|
22
|
+
if (y[1][0] === y[1][2] || (y[1][2] && y[1][1] === "^")) {
|
|
23
|
+
const [n, m] = (0, mathSeparator_1.mathSeparator)(y[1][0]);
|
|
26
24
|
if (n) {
|
|
27
|
-
|
|
25
|
+
returnValue = `${Number(y[1][0]) + m}*${n}+`;
|
|
28
26
|
if (m <= 100) {
|
|
29
|
-
|
|
27
|
+
returnValue += `${m}*${m}`;
|
|
30
28
|
}
|
|
31
29
|
else {
|
|
32
|
-
|
|
30
|
+
returnValue += (0, exports.mathConverter)(`${m}*${m}`);
|
|
31
|
+
return returnValue;
|
|
33
32
|
}
|
|
34
|
-
return
|
|
33
|
+
return returnValue;
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
|
-
return
|
|
36
|
+
return returnValue;
|
|
38
37
|
}
|
|
39
38
|
else {
|
|
40
|
-
return
|
|
39
|
+
return returnValue;
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
else {
|
|
44
|
-
return
|
|
43
|
+
return returnValue;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
};
|
package/module/Math/multiples.js
CHANGED
|
@@ -9,8 +9,10 @@ const getDecimalLength_1 = require("./getDecimalLength");
|
|
|
9
9
|
*/
|
|
10
10
|
const multiplication = (x, y) => {
|
|
11
11
|
const n = Math.pow(10, ((0, getDecimalLength_1.getDecimalLength)(x) + (0, getDecimalLength_1.getDecimalLength)(y)));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
let copyX = x;
|
|
13
|
+
let copyY = y;
|
|
14
|
+
copyX = +`${copyX}`.replace(".", "");
|
|
15
|
+
copyY = +`${copyY}`.replace(".", "");
|
|
16
|
+
return (copyX * copyY) / n;
|
|
15
17
|
};
|
|
16
18
|
exports.multiplication = multiplication;
|