umt 1.0.15 → 1.1.0

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.
Files changed (87) hide show
  1. package/module/Array/arraysJoin.js +1 -10
  2. package/module/Array/getArraysCommon.d.ts +1 -1
  3. package/module/Array/getArraysCommon.js +1 -14
  4. package/module/Array/getArraysDiff.d.ts +3 -3
  5. package/module/Array/getArraysDiff.js +2 -2
  6. package/module/Array/index.d.ts +7 -3
  7. package/module/Array/index.js +10 -28
  8. package/module/Array/quickSort.js +3 -1
  9. package/module/Date/index.d.ts +8 -3
  10. package/module/Date/index.js +14 -17
  11. package/module/Date/new.d.ts +4 -0
  12. package/module/Date/new.js +12 -0
  13. package/module/Date/now.d.ts +1 -1
  14. package/module/Date/now.js +9 -5
  15. package/module/Math/calculator/core.js +37 -40
  16. package/module/Math/calculator/exchange.js +2 -2
  17. package/module/Math/calculator/index.js +5 -4
  18. package/module/Math/calculator/literalExpression.js +4 -4
  19. package/module/Math/division.js +13 -9
  20. package/module/Math/factorial.js +5 -4
  21. package/module/Math/factorize.js +4 -3
  22. package/module/Math/gcd.js +14 -10
  23. package/module/Math/getDecimalLength.js +1 -1
  24. package/module/Math/index.d.ts +79 -40
  25. package/module/Math/index.js +81 -125
  26. package/module/Math/isDouble.js +3 -2
  27. package/module/Math/isNumber.js +3 -2
  28. package/module/Math/isPrimeNumber.js +28 -6
  29. package/module/Math/lcm.js +5 -3
  30. package/module/Math/mathConverter.js +16 -17
  31. package/module/Math/multiples.js +1 -1
  32. package/module/Math/multiplication.js +5 -3
  33. package/module/Math/nCr.js +2 -1
  34. package/module/Math/nHr.js +2 -1
  35. package/module/Math/nPr.js +14 -11
  36. package/module/Math/primeFactorization.js +5 -4
  37. package/module/Math/random.d.ts +2 -2
  38. package/module/Math/random.js +2 -2
  39. package/module/Math/reduce.js +1 -1
  40. package/module/Math/repeatedTrial.js +4 -4
  41. package/module/Math/solveEquation.d.ts +18 -0
  42. package/module/Math/solveEquation.js +72 -0
  43. package/module/Math/subtract.js +0 -6
  44. package/module/Math/valueSwap.js +7 -5
  45. package/module/Object/index.d.ts +12 -0
  46. package/module/Object/index.js +15 -0
  47. package/module/Object/objectUnion.d.ts +5 -0
  48. package/module/Object/objectUnion.js +7 -0
  49. package/module/Simple/Date/index.d.ts +1 -1
  50. package/module/Simple/Date/index.js +2 -16
  51. package/module/Simple/Date/now.js +7 -7
  52. package/module/Simple/Tool/birthday.d.ts +1 -1
  53. package/module/Simple/Tool/birthday.js +6 -6
  54. package/module/Simple/Tool/dayOfWeekSimple.d.ts +2 -2
  55. package/module/Simple/Tool/dayOfWeekSimple.js +9 -6
  56. package/module/Simple/Tool/deviationValueSimple.js +4 -3
  57. package/module/Simple/Tool/index.d.ts +6 -4
  58. package/module/Simple/Tool/index.js +6 -22
  59. package/module/Simple/index.d.ts +4 -3
  60. package/module/Simple/index.js +6 -21
  61. package/module/String/index.d.ts +8 -0
  62. package/module/String/index.js +15 -0
  63. package/module/String/reverseString.d.ts +1 -0
  64. package/module/String/reverseString.js +7 -0
  65. package/module/Tool/birthday.js +1 -2
  66. package/module/Tool/dayOfWeek.d.ts +2 -2
  67. package/module/Tool/dayOfWeek.js +2 -2
  68. package/module/Tool/index.d.ts +8 -3
  69. package/module/Tool/index.js +12 -31
  70. package/module/Tool/isBrowser.js +1 -1
  71. package/module/index.d.ts +14 -6
  72. package/module/index.js +25 -33
  73. package/module/tsconfig.tsbuildinfo +1 -1
  74. package/module/types/clockType.d.ts +9 -0
  75. package/module/types/dateType.d.ts +11 -0
  76. package/module/types/dateType.js +2 -0
  77. package/module/types/int.d.ts +4 -4
  78. package/module/types/logicType.d.ts +9 -8
  79. package/package.json +16 -8
  80. package/.markdownlint.json +0 -6
  81. package/.nvmrc +0 -1
  82. package/jest.config.js +0 -16
  83. package/make_test.py +0 -24
  84. package/module/Math/softmax.d.ts +0 -5
  85. package/module/Math/softmax.js +0 -40
  86. package/module/types/monType.d.ts +0 -8
  87. /package/module/types/{monType.js → clockType.js} +0 -0
@@ -1,43 +1,81 @@
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 { standardDeviation } from './standardDeviation';
33
- import { subtract } from './subtract';
34
- import { toBinary } from './toBinary';
35
- import { toCelsius } from './toCelsius';
36
- import { toKelvin } from './toKelvin';
37
- import { valueSwap } from './valueSwap';
38
- 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, standardDeviation, subtract, toBinary, toCelsius, toKelvin, valueSwap, };
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
- #private;
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(): (num: number, min?: number) => number;
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;
@@ -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
- _UMTMathClass_Local_addition.set(this, void 0);
93
- _UMTMathClass_Local_average.set(this, void 0);
94
- _UMTMathClass_Local_calculator.set(this, void 0);
95
- _UMTMathClass_Local_calculatorInitialization.set(this, void 0);
96
- _UMTMathClass_Local_degToRad.set(this, void 0);
97
- _UMTMathClass_Local_deviationValue.set(this, void 0);
98
- _UMTMathClass_Local_division.set(this, void 0);
99
- _UMTMathClass_Local_factorial.set(this, void 0);
100
- _UMTMathClass_Local_factorize.set(this, void 0);
101
- _UMTMathClass_Local_gcd.set(this, void 0);
102
- _UMTMathClass_Local_getDecimalLength.set(this, void 0);
103
- _UMTMathClass_Local_isDouble.set(this, void 0);
104
- _UMTMathClass_Local_isNumber.set(this, void 0);
105
- _UMTMathClass_Local_isPrimeNumber.set(this, void 0);
106
- _UMTMathClass_Local_lcm.set(this, void 0);
107
- _UMTMathClass_Local_mathConverter.set(this, void 0);
108
- _UMTMathClass_Local_mathSeparator.set(this, void 0);
109
- _UMTMathClass_Local_max.set(this, void 0);
110
- _UMTMathClass_Local_min.set(this, void 0);
111
- _UMTMathClass_Local_multiples.set(this, void 0);
112
- _UMTMathClass_Local_multiplication.set(this, void 0);
113
- _UMTMathClass_Local_nCr.set(this, void 0);
114
- _UMTMathClass_Local_nHr.set(this, void 0);
115
- _UMTMathClass_Local_nPr.set(this, void 0);
116
- _UMTMathClass_Local_primeFactorization.set(this, void 0);
117
- _UMTMathClass_Local_quotient.set(this, void 0);
118
- _UMTMathClass_Local_radToDeg.set(this, void 0);
119
- _UMTMathClass_Local_random.set(this, void 0);
120
- _UMTMathClass_Local_reduce.set(this, void 0);
121
- _UMTMathClass_Local_repeatedTrial.set(this, void 0);
122
- _UMTMathClass_Local_roundOf.set(this, void 0);
123
- _UMTMathClass_Local_standardDeviation.set(this, void 0);
124
- _UMTMathClass_Local_subtract.set(this, void 0);
125
- _UMTMathClass_Local_toBinary.set(this, void 0);
126
- _UMTMathClass_Local_toCelsius.set(this, void 0);
127
- _UMTMathClass_Local_toKelvin.set(this, void 0);
128
- _UMTMathClass_Local_valueSwap.set(this, void 0);
129
- __classPrivateFieldSet(this, _UMTMathClass_Local_addition, addition_1.addition, "f");
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 __classPrivateFieldGet(this, _UMTMathClass_Local_addition, "f");
122
+ return this.localAddition;
169
123
  }
170
124
  get average() {
171
- return __classPrivateFieldGet(this, _UMTMathClass_Local_average, "f");
125
+ return this.localAverage;
172
126
  }
173
127
  get calculator() {
174
- return __classPrivateFieldGet(this, _UMTMathClass_Local_calculator, "f");
128
+ return this.localCalculator;
175
129
  }
176
130
  get calculatorInitialization() {
177
- return __classPrivateFieldGet(this, _UMTMathClass_Local_calculatorInitialization, "f");
131
+ return this.localCalculatorInitialization;
178
132
  }
179
133
  get degToRad() {
180
- return __classPrivateFieldGet(this, _UMTMathClass_Local_degToRad, "f");
134
+ return this.localDegToRad;
181
135
  }
182
136
  get deviationValue() {
183
- return __classPrivateFieldGet(this, _UMTMathClass_Local_deviationValue, "f");
137
+ return this.localDeviationValue;
184
138
  }
185
139
  get division() {
186
- return __classPrivateFieldGet(this, _UMTMathClass_Local_division, "f");
140
+ return this.localDivision;
187
141
  }
188
142
  get factorial() {
189
- return __classPrivateFieldGet(this, _UMTMathClass_Local_factorial, "f");
143
+ return this.localFactorial;
190
144
  }
191
145
  get factorize() {
192
- return __classPrivateFieldGet(this, _UMTMathClass_Local_factorize, "f");
146
+ return this.localFactorize;
193
147
  }
194
148
  get gcd() {
195
- return __classPrivateFieldGet(this, _UMTMathClass_Local_gcd, "f");
149
+ return this.localGcd;
196
150
  }
197
151
  get getDecimalLength() {
198
- return __classPrivateFieldGet(this, _UMTMathClass_Local_getDecimalLength, "f");
152
+ return this.localGetDecimalLength;
199
153
  }
200
154
  get isDouble() {
201
- return __classPrivateFieldGet(this, _UMTMathClass_Local_isDouble, "f");
155
+ return this.localIsDouble;
202
156
  }
203
157
  get isNumber() {
204
- return __classPrivateFieldGet(this, _UMTMathClass_Local_isNumber, "f");
158
+ return this.localIsNumber;
205
159
  }
206
160
  get isPrimeNumber() {
207
- return __classPrivateFieldGet(this, _UMTMathClass_Local_isPrimeNumber, "f");
161
+ return this.localIsPrimeNumber;
208
162
  }
209
163
  get lcm() {
210
- return __classPrivateFieldGet(this, _UMTMathClass_Local_lcm, "f");
164
+ return this.localLcm;
211
165
  }
212
166
  get mathConverter() {
213
- return __classPrivateFieldGet(this, _UMTMathClass_Local_mathConverter, "f");
167
+ return this.localMathConverter;
214
168
  }
215
169
  get mathSeparator() {
216
- return __classPrivateFieldGet(this, _UMTMathClass_Local_mathSeparator, "f");
170
+ return this.localMathSeparator;
217
171
  }
218
172
  get max() {
219
- return __classPrivateFieldGet(this, _UMTMathClass_Local_max, "f");
173
+ return this.localMax;
220
174
  }
221
175
  get min() {
222
- return __classPrivateFieldGet(this, _UMTMathClass_Local_min, "f");
176
+ return this.localMin;
223
177
  }
224
178
  get multiples() {
225
- return __classPrivateFieldGet(this, _UMTMathClass_Local_multiples, "f");
179
+ return this.localMultiples;
226
180
  }
227
181
  get multiplication() {
228
- return __classPrivateFieldGet(this, _UMTMathClass_Local_multiplication, "f");
182
+ return this.localMultiplication;
229
183
  }
230
184
  get nCr() {
231
- return __classPrivateFieldGet(this, _UMTMathClass_Local_nCr, "f");
185
+ return this.localNCr;
232
186
  }
233
187
  get nHr() {
234
- return __classPrivateFieldGet(this, _UMTMathClass_Local_nHr, "f");
188
+ return this.localNHr;
235
189
  }
236
190
  get nPr() {
237
- return __classPrivateFieldGet(this, _UMTMathClass_Local_nPr, "f");
191
+ return this.localNPr;
238
192
  }
239
193
  get primeFactorization() {
240
- return __classPrivateFieldGet(this, _UMTMathClass_Local_primeFactorization, "f");
194
+ return this.localPrimeFactorization;
241
195
  }
242
196
  get quotient() {
243
- return __classPrivateFieldGet(this, _UMTMathClass_Local_quotient, "f");
197
+ return this.localQuotient;
244
198
  }
245
199
  get radToDeg() {
246
- return __classPrivateFieldGet(this, _UMTMathClass_Local_radToDeg, "f");
200
+ return this.localRadToDeg;
247
201
  }
248
202
  get random() {
249
- return __classPrivateFieldGet(this, _UMTMathClass_Local_random, "f");
203
+ return this.localRandom;
250
204
  }
251
205
  get reduce() {
252
- return __classPrivateFieldGet(this, _UMTMathClass_Local_reduce, "f");
206
+ return this.localReduce;
253
207
  }
254
208
  get repeatedTrial() {
255
- return __classPrivateFieldGet(this, _UMTMathClass_Local_repeatedTrial, "f");
209
+ return this.localRepeatedTrial;
256
210
  }
257
211
  get roundOf() {
258
- return __classPrivateFieldGet(this, _UMTMathClass_Local_roundOf, "f");
212
+ return this.localRoundOf;
213
+ }
214
+ get solveEquation() {
215
+ return this.localSolveEquation;
259
216
  }
260
217
  get standardDeviation() {
261
- return __classPrivateFieldGet(this, _UMTMathClass_Local_standardDeviation, "f");
218
+ return this.localStandardDeviation;
262
219
  }
263
220
  get subtract() {
264
- return __classPrivateFieldGet(this, _UMTMathClass_Local_subtract, "f");
221
+ return this.localSubtract;
265
222
  }
266
223
  get toBinary() {
267
- return __classPrivateFieldGet(this, _UMTMathClass_Local_toBinary, "f");
224
+ return this.localToBinary;
268
225
  }
269
226
  get toCelsius() {
270
- return __classPrivateFieldGet(this, _UMTMathClass_Local_toCelsius, "f");
227
+ return this.localToCelsius;
271
228
  }
272
229
  get toKelvin() {
273
- return __classPrivateFieldGet(this, _UMTMathClass_Local_toKelvin, "f");
230
+ return this.localToKelvin;
274
231
  }
275
232
  get valueSwap() {
276
- return __classPrivateFieldGet(this, _UMTMathClass_Local_valueSwap, "f");
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();
@@ -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) &&
@@ -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
- if (n < 2)
12
+ // Check for trivial cases
13
+ if (n <= 1) {
12
14
  return false;
13
- else if (n == 2)
15
+ }
16
+ else if (n <= 3) {
14
17
  return true;
15
- else if (n % 2 == 0)
18
+ }
19
+ else if (n % 2 === 0 || n % 3 === 0) {
16
20
  return false;
17
- for (let i = 3; i <= Math.sqrt(n); i++) {
18
- if ((0, division_1.division)(n, i, false)[1] == 0) {
19
- return false;
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;
@@ -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 (x === 0 || y === 0) {
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
- [x, y] = (0, valueSwap_1.valueSwap)(x, y);
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 (x / (0, gcd_1.gcd)(x, y)) * y;
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 (x.indexOf('^') != -1 || x.indexOf('*') != -1) {
12
+ if (returnValue.indexOf("^") !== -1 || returnValue.indexOf("*") !== -1) {
12
13
  //掛け算と割り算の処理
13
14
  const y = [
14
- x.match(/\d+\.?(\d+)?(\*|\^)\d+\.?(\d+)?/),
15
- [''],
15
+ returnValue.match(/\d+\.?(\d+)?(\*|\^)\d+\.?(\d+)?/),
16
+ [""],
16
17
  ];
17
18
  if (y[0]) {
18
- y[1] = y[0][0]
19
- .split(/(\d+\.\d+)|(\d+)/g)
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] == y[1][2] ||
24
- (y[1][2] && y[1][1] == '^')) {
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
- x = `${Number(y[1][0]) + m}*${n}+`;
25
+ returnValue = `${Number(y[1][0]) + m}*${n}+`;
28
26
  if (m <= 100) {
29
- x += `${m}*${m}`;
27
+ returnValue += `${m}*${m}`;
30
28
  }
31
29
  else {
32
- return (x += (0, exports.mathConverter)(`${m}*${m}`));
30
+ returnValue += (0, exports.mathConverter)(`${m}*${m}`);
31
+ return returnValue;
33
32
  }
34
- return x;
33
+ return returnValue;
35
34
  }
36
35
  }
37
- return x;
36
+ return returnValue;
38
37
  }
39
38
  else {
40
- return x;
39
+ return returnValue;
41
40
  }
42
41
  }
43
42
  else {
44
- return x;
43
+ return returnValue;
45
44
  }
46
45
  }
47
46
  };
@@ -7,7 +7,7 @@ exports.multiples = void 0;
7
7
  * @param {number} n
8
8
  */
9
9
  const multiples = (x, n) => {
10
- let result = [];
10
+ const result = [];
11
11
  for (let i = 1; i <= n; i++) {
12
12
  result.push(x * i);
13
13
  }
@@ -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
- x = +(x + '').replace('.', '');
13
- y = +(y + '').replace('.', '');
14
- return (x * y) / n;
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;