@melonproject/token-math
Version:
A small helper library to do precision safe calculations
12 lines (11 loc) • 596 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsbi_1 = __importDefault(require("jsbi"));
const BigInteger_1 = __importDefault(require("./BigInteger"));
const absolute_1 = __importDefault(require("./absolute"));
const toBI_1 = __importDefault(require("./toBI"));
const power = (a, b) => new BigInteger_1.default(jsbi_1.default.exponentiate(toBI_1.default(a).value, absolute_1.default(b).value));
exports.default = power;