umt 1.0.6 → 1.0.9
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/node.js.yml +1 -1
- package/.nvmrc +1 -0
- package/README.md +3 -1
- package/module/Array/arraysJoin.d.ts +7 -0
- package/module/{arraysJoin.js → Array/arraysJoin.js} +5 -0
- package/module/Array/getArraysDiff.d.ts +7 -0
- package/module/{getArraysDiff.js → Array/getArraysDiff.js} +5 -0
- package/module/Array/getArraysIntersect.d.ts +7 -0
- package/module/{getArraysIntersect.js → Array/getArraysIntersect.js} +5 -0
- package/module/Array/index.d.ts +5 -0
- package/module/Array/index.js +14 -0
- package/module/Array/quickSort.d.ts +8 -0
- package/module/{quickSort.js → Array/quickSort.js} +7 -1
- package/module/Date/index.d.ts +2 -0
- package/module/Date/index.js +8 -0
- package/module/Date/now.d.ts +2 -0
- package/module/Date/now.js +5 -0
- package/module/{addition.d.ts → Math/addition.d.ts} +5 -0
- package/module/{addition.js → Math/addition.js} +6 -1
- package/module/Math/average.d.ts +6 -0
- package/module/Math/average.js +12 -0
- package/module/Math/calculator/core.d.ts +11 -0
- package/module/{calculator.js → Math/calculator/core.js} +19 -15
- package/module/Math/calculator/exchange.d.ts +5 -0
- package/module/Math/calculator/exchange.js +20 -0
- package/module/Math/calculator/index.d.ts +11 -0
- package/module/Math/calculator/index.js +17 -0
- package/module/Math/calculator/literalExpression.d.ts +5 -0
- package/module/Math/calculator/literalExpression.js +50 -0
- package/module/{degToRad.d.ts → Math/degToRad.d.ts} +4 -0
- package/module/{degToRad.js → Math/degToRad.js} +4 -0
- package/module/{division.d.ts → Math/division.d.ts} +5 -0
- package/module/{division.js → Math/division.js} +6 -1
- package/module/{euclideanAlgorithm.d.ts → Math/euclideanAlgorithm.d.ts} +6 -0
- package/module/{euclideanAlgorithm.js → Math/euclideanAlgorithm.js} +7 -0
- package/module/Math/factorial.d.ts +6 -0
- package/module/Math/factorial.js +13 -0
- package/module/Math/factorize.d.ts +6 -0
- package/module/Math/factorize.js +17 -0
- package/module/Math/gcd.d.ts +8 -0
- package/module/Math/gcd.js +31 -0
- package/module/{getDecimalLength.d.ts → Math/getDecimalLength.d.ts} +4 -0
- package/module/{getDecimalLength.js → Math/getDecimalLength.js} +4 -0
- package/module/Math/index.d.ts +33 -0
- package/module/Math/index.js +70 -0
- package/module/{isDouble.d.ts → Math/isDouble.d.ts} +4 -0
- package/module/{isDouble.js → Math/isDouble.js} +4 -0
- package/module/Math/isNumber.d.ts +7 -0
- package/module/{isNumber.js → Math/isNumber.js} +5 -0
- package/module/{isPrimeNumber.d.ts → Math/isPrimeNumber.d.ts} +4 -0
- package/module/{isPrimeNumber.js → Math/isPrimeNumber.js} +4 -0
- package/module/{lcm.d.ts → Math/lcm.d.ts} +5 -0
- package/module/{lcm.js → Math/lcm.js} +7 -2
- package/module/Math/max.d.ts +6 -0
- package/module/Math/max.js +8 -0
- package/module/{min.d.ts → Math/min.d.ts} +4 -0
- package/module/{min.js → Math/min.js} +4 -0
- package/module/Math/multiples.d.ts +7 -0
- package/module/Math/multiples.js +15 -0
- package/module/{multiplication.d.ts → Math/multiplication.d.ts} +5 -0
- package/module/{multiplication.js → Math/multiplication.js} +6 -1
- package/module/{nCr.d.ts → Math/nCr.d.ts} +5 -0
- package/module/{nCr.js → Math/nCr.js} +6 -0
- package/module/Math/nHr.d.ts +7 -0
- package/module/{nCrs.js → Math/nHr.js} +7 -2
- package/module/{nPr.d.ts → Math/nPr.d.ts} +5 -0
- package/module/{nPr.js → Math/nPr.js} +6 -0
- package/module/{primeFactorization.d.ts → Math/primeFactorization.d.ts} +4 -0
- package/module/{primeFactorization.js → Math/primeFactorization.js} +4 -0
- package/module/{quotient.d.ts → Math/quotient.d.ts} +5 -0
- package/module/{quotient.js → Math/quotient.js} +5 -0
- package/module/{radToDeg.d.ts → Math/radToDeg.d.ts} +4 -0
- package/module/{radToDeg.js → Math/radToDeg.js} +4 -0
- package/module/{random.d.ts → Math/random.d.ts} +4 -0
- package/module/{random.js → Math/random.js} +4 -0
- package/module/{reduce.d.ts → Math/reduce.d.ts} +5 -0
- package/module/{reduce.js → Math/reduce.js} +8 -3
- package/module/{repeatedTrial.d.ts → Math/repeatedTrial.d.ts} +6 -0
- package/module/Math/repeatedTrial.js +24 -0
- package/module/Math/standardDeviation.d.ts +6 -0
- package/module/Math/standardDeviation.js +22 -0
- package/module/{subtract.d.ts → Math/subtract.d.ts} +5 -0
- package/module/{subtract.js → Math/subtract.js} +6 -1
- package/module/{toBinary.d.ts → Math/toBinary.d.ts} +5 -0
- package/module/{toBinary.js → Math/toBinary.js} +5 -0
- package/module/Math/toCelsius.d.ts +2 -0
- package/module/Math/toCelsius.js +8 -0
- package/module/Math/toKelvin.d.ts +2 -0
- package/module/Math/toKelvin.js +8 -0
- package/module/Math/value.d.ts +2 -0
- package/module/Math/value.js +4 -0
- package/module/Math/valueSwap.d.ts +7 -0
- package/module/{valueSwap.js → Math/valueSwap.js} +5 -0
- package/module/Tool/birthday.d.ts +2 -0
- package/module/Tool/birthday.js +17 -0
- package/module/Tool/dayOfWeek.d.ts +6 -0
- package/module/Tool/dayOfWeek.js +4 -0
- package/module/Tool/index.d.ts +4 -0
- package/module/Tool/index.js +12 -0
- package/module/Tool/pipeFunction.d.ts +6 -0
- package/module/Tool/pipeFunction.js +4 -0
- package/module/index.d.ts +8 -75
- package/module/index.js +30 -93
- package/module/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/test.js +5 -0
- package/.github/workflows/npm-publish.yml +0 -34
- package/module/arraysJoin.d.ts +0 -2
- package/module/calculator.d.ts +0 -2
- package/module/fact.d.ts +0 -2
- package/module/fact.js +0 -11
- package/module/getArraysDiff.d.ts +0 -2
- package/module/getArraysIntersect.d.ts +0 -2
- package/module/isNumber.d.ts +0 -2
- package/module/max.d.ts +0 -2
- package/module/max.js +0 -4
- package/module/nCrs.d.ts +0 -2
- package/module/quickSort.d.ts +0 -2
- package/module/repeatedTrial.js +0 -15
- package/module/valueSwap.d.ts +0 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.toCelsius = exports.toKelvin = exports.multiples = exports.factorize = exports.standardDeviation = exports.average = exports.gcd = exports.random = exports.calculator = exports.primeFactorization = exports.radToDeg = exports.degToRad = exports.toBinary = exports.isPrimeNumber = exports.division = exports.addition = exports.multiplication = exports.subtract = exports.getDecimalLength = exports.valueSwap = exports.isNumber = exports.isDouble = exports.min = exports.max = exports.repeatedTrial = exports.reduce = exports.quotient = exports.nPr = exports.nHr = exports.nCr = exports.lcm = exports.factorial = void 0;
|
|
7
|
+
const addition_1 = __importDefault(require("./addition"));
|
|
8
|
+
exports.addition = addition_1.default;
|
|
9
|
+
const average_1 = __importDefault(require("./average"));
|
|
10
|
+
exports.average = average_1.default;
|
|
11
|
+
const calculator_1 = __importDefault(require("./calculator"));
|
|
12
|
+
exports.calculator = calculator_1.default;
|
|
13
|
+
const degToRad_1 = __importDefault(require("./degToRad"));
|
|
14
|
+
exports.degToRad = degToRad_1.default;
|
|
15
|
+
const division_1 = __importDefault(require("./division"));
|
|
16
|
+
exports.division = division_1.default;
|
|
17
|
+
const gcd_1 = __importDefault(require("./gcd"));
|
|
18
|
+
exports.gcd = gcd_1.default;
|
|
19
|
+
const factorial_1 = __importDefault(require("./factorial"));
|
|
20
|
+
exports.factorial = factorial_1.default;
|
|
21
|
+
const factorize_1 = __importDefault(require("./factorize"));
|
|
22
|
+
exports.factorize = factorize_1.default;
|
|
23
|
+
const getDecimalLength_1 = __importDefault(require("./getDecimalLength"));
|
|
24
|
+
exports.getDecimalLength = getDecimalLength_1.default;
|
|
25
|
+
const isDouble_1 = __importDefault(require("./isDouble"));
|
|
26
|
+
exports.isDouble = isDouble_1.default;
|
|
27
|
+
const isNumber_1 = __importDefault(require("./isNumber"));
|
|
28
|
+
exports.isNumber = isNumber_1.default;
|
|
29
|
+
const isPrimeNumber_1 = __importDefault(require("./isPrimeNumber"));
|
|
30
|
+
exports.isPrimeNumber = isPrimeNumber_1.default;
|
|
31
|
+
const lcm_1 = __importDefault(require("./lcm"));
|
|
32
|
+
exports.lcm = lcm_1.default;
|
|
33
|
+
const max_1 = __importDefault(require("./max"));
|
|
34
|
+
exports.max = max_1.default;
|
|
35
|
+
const min_1 = __importDefault(require("./min"));
|
|
36
|
+
exports.min = min_1.default;
|
|
37
|
+
const multiples_1 = __importDefault(require("./multiples"));
|
|
38
|
+
exports.multiples = multiples_1.default;
|
|
39
|
+
const multiplication_1 = __importDefault(require("./multiplication"));
|
|
40
|
+
exports.multiplication = multiplication_1.default;
|
|
41
|
+
const nCr_1 = __importDefault(require("./nCr"));
|
|
42
|
+
exports.nCr = nCr_1.default;
|
|
43
|
+
const nHr_1 = __importDefault(require("./nHr"));
|
|
44
|
+
exports.nHr = nHr_1.default;
|
|
45
|
+
const nPr_1 = __importDefault(require("./nPr"));
|
|
46
|
+
exports.nPr = nPr_1.default;
|
|
47
|
+
const primeFactorization_1 = __importDefault(require("./primeFactorization"));
|
|
48
|
+
exports.primeFactorization = primeFactorization_1.default;
|
|
49
|
+
const quotient_1 = __importDefault(require("./quotient"));
|
|
50
|
+
exports.quotient = quotient_1.default;
|
|
51
|
+
const radToDeg_1 = __importDefault(require("./radToDeg"));
|
|
52
|
+
exports.radToDeg = radToDeg_1.default;
|
|
53
|
+
const random_1 = __importDefault(require("./random"));
|
|
54
|
+
exports.random = random_1.default;
|
|
55
|
+
const reduce_1 = __importDefault(require("./reduce"));
|
|
56
|
+
exports.reduce = reduce_1.default;
|
|
57
|
+
const repeatedTrial_1 = __importDefault(require("./repeatedTrial"));
|
|
58
|
+
exports.repeatedTrial = repeatedTrial_1.default;
|
|
59
|
+
const standardDeviation_1 = __importDefault(require("./standardDeviation"));
|
|
60
|
+
exports.standardDeviation = standardDeviation_1.default;
|
|
61
|
+
const subtract_1 = __importDefault(require("./subtract"));
|
|
62
|
+
exports.subtract = subtract_1.default;
|
|
63
|
+
const toBinary_1 = __importDefault(require("./toBinary"));
|
|
64
|
+
exports.toBinary = toBinary_1.default;
|
|
65
|
+
const toCelsius_1 = __importDefault(require("./toCelsius"));
|
|
66
|
+
exports.toCelsius = toCelsius_1.default;
|
|
67
|
+
const toKelvin_1 = __importDefault(require("./toKelvin"));
|
|
68
|
+
exports.toKelvin = toKelvin_1.default;
|
|
69
|
+
const valueSwap_1 = __importDefault(require("./valueSwap"));
|
|
70
|
+
exports.valueSwap = valueSwap_1.default;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* 数字かどうか
|
|
5
|
+
* @param {any} x
|
|
6
|
+
* @param {boolean} loose 曖昧な判定を許すかどうか(default:true)
|
|
7
|
+
*/
|
|
3
8
|
const isNumber = (x, loose = true) => {
|
|
4
9
|
return x !== null && typeof x !== 'boolean' && loose
|
|
5
10
|
? isFinite(x)
|
|
@@ -4,6 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const division_1 = __importDefault(require("./division"));
|
|
7
|
+
/**
|
|
8
|
+
* 素数判定
|
|
9
|
+
* @param {number} n
|
|
10
|
+
*/
|
|
7
11
|
const isPrimeNumber = (n) => {
|
|
8
12
|
if (n < 2)
|
|
9
13
|
return false;
|
|
@@ -3,13 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const gcd_1 = __importDefault(require("./gcd"));
|
|
7
7
|
const valueSwap_1 = __importDefault(require("./valueSwap"));
|
|
8
|
+
/**
|
|
9
|
+
* 最小公倍数
|
|
10
|
+
* @param {number} x
|
|
11
|
+
* @param {number} y
|
|
12
|
+
*/
|
|
8
13
|
const lcm = (x, y) => {
|
|
9
14
|
if (x === 0 || y === 0) {
|
|
10
15
|
return 0;
|
|
11
16
|
}
|
|
12
17
|
[x, y] = (0, valueSwap_1.default)(x, y);
|
|
13
|
-
return (x / (0,
|
|
18
|
+
return (x / (0, gcd_1.default)(x, y)) * y;
|
|
14
19
|
};
|
|
15
20
|
exports.default = lcm;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* 倍数
|
|
5
|
+
* @param {number} x
|
|
6
|
+
* @param {number} n
|
|
7
|
+
*/
|
|
8
|
+
const multiples = (x, n) => {
|
|
9
|
+
let result = [];
|
|
10
|
+
for (let i = 1; i <= n; i++) {
|
|
11
|
+
result.push(x * i);
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
exports.default = multiples;
|
|
@@ -4,8 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const getDecimalLength_1 = __importDefault(require("./getDecimalLength"));
|
|
7
|
+
/**
|
|
8
|
+
* 誤差のない掛け算
|
|
9
|
+
* @param {number} x
|
|
10
|
+
* @param {number} y
|
|
11
|
+
*/
|
|
7
12
|
const multiplication = (x, y) => {
|
|
8
|
-
const n =
|
|
13
|
+
const n = 10 ** ((0, getDecimalLength_1.default)(x) + (0, getDecimalLength_1.default)(y));
|
|
9
14
|
x = +(x + '').replace('.', '');
|
|
10
15
|
y = +(y + '').replace('.', '');
|
|
11
16
|
return (x * y) / n;
|
|
@@ -4,7 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const nPr_1 = __importDefault(require("./nPr"));
|
|
7
|
+
/**
|
|
8
|
+
* nCr
|
|
9
|
+
* @param {number} n
|
|
10
|
+
* @param {number} r
|
|
11
|
+
*/
|
|
7
12
|
const nCr = (n, r) => {
|
|
13
|
+
//nCr
|
|
8
14
|
let y = (0, nPr_1.default)(n, r);
|
|
9
15
|
let age = 1;
|
|
10
16
|
for (let i = 2; i <= r; i++) {
|
|
@@ -4,7 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const nCr_1 = __importDefault(require("./nCr"));
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* 重複を許して取り出す
|
|
9
|
+
* @param {number} n
|
|
10
|
+
* @param {number} r
|
|
11
|
+
*/
|
|
12
|
+
const nHr = (n, r) => {
|
|
8
13
|
if (n === 0 || r === 0) {
|
|
9
14
|
return NaN;
|
|
10
15
|
}
|
|
@@ -13,4 +18,4 @@ const nCrs = (n, r) => {
|
|
|
13
18
|
return 0;
|
|
14
19
|
return y;
|
|
15
20
|
};
|
|
16
|
-
exports.default =
|
|
21
|
+
exports.default = nHr;
|
|
@@ -3,12 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const gcd_1 = __importDefault(require("./gcd"));
|
|
7
|
+
/**
|
|
8
|
+
* 約分
|
|
9
|
+
* @param {number} x
|
|
10
|
+
* @param {number} y
|
|
11
|
+
*/
|
|
7
12
|
const reduce = (x, y) => {
|
|
8
13
|
if (x === 0 || y === 0) {
|
|
9
14
|
return { x: NaN, y: NaN };
|
|
10
15
|
}
|
|
11
|
-
let n = (0,
|
|
12
|
-
return { x: x / n, y: y / n, gcd: (0,
|
|
16
|
+
let n = (0, gcd_1.default)(x, y);
|
|
17
|
+
return { x: x / n, y: y / n, gcd: (0, gcd_1.default)(x, y) };
|
|
13
18
|
};
|
|
14
19
|
exports.default = reduce;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const gcd_1 = __importDefault(require("./gcd"));
|
|
7
|
+
const nCr_1 = __importDefault(require("./nCr"));
|
|
8
|
+
/**
|
|
9
|
+
* 反復的な思考
|
|
10
|
+
* @param {number} n
|
|
11
|
+
* @param {number} r
|
|
12
|
+
* @param {{x:number;y:number}} p
|
|
13
|
+
*/
|
|
14
|
+
const repeatedTrial = (n, r, p) => {
|
|
15
|
+
let x = (0, nCr_1.default)(n, r);
|
|
16
|
+
let answer1 = x * Math.pow(p.x, r) * Math.pow(p.y - p.x, n - r);
|
|
17
|
+
let answer2 = Math.pow(p.y, r) * Math.pow(p.y, n - r);
|
|
18
|
+
let greatest_common_divisor = (0, gcd_1.default)(answer1, answer2);
|
|
19
|
+
return [
|
|
20
|
+
answer1 / greatest_common_divisor,
|
|
21
|
+
answer2 / greatest_common_divisor,
|
|
22
|
+
];
|
|
23
|
+
};
|
|
24
|
+
exports.default = repeatedTrial;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const average_1 = __importDefault(require("./average"));
|
|
7
|
+
/**
|
|
8
|
+
* 標準偏差
|
|
9
|
+
* @param {number[]} values
|
|
10
|
+
*/
|
|
11
|
+
const standardDeviation = (values) => {
|
|
12
|
+
const avg = (0, average_1.default)(values);
|
|
13
|
+
const squareDiffs = values.map((value) => {
|
|
14
|
+
const diff = value - avg;
|
|
15
|
+
const sqrDiff = diff * diff;
|
|
16
|
+
return sqrDiff;
|
|
17
|
+
});
|
|
18
|
+
const avgSquareDiff = (0, average_1.default)(squareDiffs);
|
|
19
|
+
const stdDev = Math.sqrt(avgSquareDiff);
|
|
20
|
+
return stdDev;
|
|
21
|
+
};
|
|
22
|
+
exports.default = standardDeviation;
|
|
@@ -6,8 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const getDecimalLength_1 = __importDefault(require("./getDecimalLength"));
|
|
7
7
|
const max_1 = __importDefault(require("./max"));
|
|
8
8
|
const multiplication_1 = __importDefault(require("./multiplication"));
|
|
9
|
+
/**
|
|
10
|
+
* 誤差のない引き算
|
|
11
|
+
* @param {number} x
|
|
12
|
+
* @param {number} y
|
|
13
|
+
*/
|
|
9
14
|
const subtract = (x, y) => {
|
|
10
|
-
const z = Math.pow(10, (0, max_1.default)((0, getDecimalLength_1.default)(x), (0, getDecimalLength_1.default)(y)));
|
|
15
|
+
const z = Math.pow(10, (0, max_1.default)([(0, getDecimalLength_1.default)(x), (0, getDecimalLength_1.default)(y)]));
|
|
11
16
|
return ((0, multiplication_1.default)(x, z) - (0, multiplication_1.default)(y, z)) / z;
|
|
12
17
|
};
|
|
13
18
|
exports.default = subtract;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* n進数に変換
|
|
5
|
+
* @param {number} x
|
|
6
|
+
* @param {number} [radix=2] n進数
|
|
7
|
+
*/
|
|
3
8
|
const toBinary = (x, radix = 2) => {
|
|
4
9
|
if (typeof x === 'undefined') {
|
|
5
10
|
return (x, radix = 2) => toBinary(x, radix);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const subtract_1 = __importDefault(require("./subtract"));
|
|
7
|
+
const toCelsius = (kelvin) => (0, subtract_1.default)(kelvin, 273.15);
|
|
8
|
+
exports.default = toCelsius;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const addition_1 = __importDefault(require("./addition"));
|
|
7
|
+
const toKelvin = (celsius) => (0, addition_1.default)(celsius, 273.15);
|
|
8
|
+
exports.default = toKelvin;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const now_1 = __importDefault(require("../Date/now"));
|
|
7
|
+
const birthday = (yer, mon, day) => {
|
|
8
|
+
const birthday = new Date(yer < 0 ? -yer : yer, mon < 0 ? -mon - 1 : mon - 1, day < 0 ? -day : day);
|
|
9
|
+
const nowTime = (0, now_1.default)();
|
|
10
|
+
const y = nowTime.getFullYear() - birthday.getFullYear();
|
|
11
|
+
const r = nowTime <
|
|
12
|
+
new Date(nowTime.getFullYear(), birthday.getMonth(), birthday.getDate())
|
|
13
|
+
? y - 1
|
|
14
|
+
: y;
|
|
15
|
+
return yer < 100 ? 1900 + y : r;
|
|
16
|
+
};
|
|
17
|
+
exports.default = birthday;
|