From 2f20bb7f9841d3ec080581c0950032a676d81f2f Mon Sep 17 00:00:00 2001 From: Stanimir Barakov Date: Tue, 22 Nov 2022 10:07:27 +0200 Subject: [PATCH] remove redundant files --- src/lib/utils/math.js | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 src/lib/utils/math.js diff --git a/src/lib/utils/math.js b/src/lib/utils/math.js deleted file mode 100644 index dcfbc25..0000000 --- a/src/lib/utils/math.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict' - -const {modInv} = require("bigint-mod-arith"); -const BigNumber = require("bignumber.js"); - -/** - * @param {BigNumber} x - * @param {BigNumber} y - * @return {BigNumber} - */ -function euclideanMod(x, y) { - if (x.lt(0)) { - const res = x.modulo(y); - return res.plus(y); - } - - if (x.lt(y)) { - return x; - } - - return x.modulo(y); -} - -/** - * @param {BigNumber} x - * @param {BigNumber} y - * @return {BigNumber} - */ -function modInverse(x, y) { - const res = modInv(BigInt(x.toFixed()), BigInt(y.toFixed())); - - return new BigNumber(res.toString()); -} - -module.exports = { - euclideanMod: euclideanMod, - modInv: modInverse, -} \ No newline at end of file