UNPKG

@lidofinance/lido-ethereum-sdk

Version:

<div style="display: flex;" align="center"> <h1 align="center">Lido Ethereum SDK</h1> </div>

23 lines 949 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.bigIntCeilDiv = exports.bigIntSign = exports.bigIntAbs = exports.bigIntMin = exports.bigIntMax = void 0; const bigIntMax = (...args) => args.reduce((a, b) => (a > b ? a : b)); exports.bigIntMax = bigIntMax; const bigIntMin = (...args) => args.reduce((a, b) => (a < b ? a : b)); exports.bigIntMin = bigIntMin; const bigIntAbs = (value) => value < 0n ? -value : value; exports.bigIntAbs = bigIntAbs; const bigIntSign = (value) => { return value >= 0n ? 1n : -1n; }; exports.bigIntSign = bigIntSign; const bigIntCeilDiv = (numerator, denominator) => { if (denominator === 0n) { throw new Error('DIVISION_BY_ZERO'); } const quotient = numerator / denominator; const remainder = numerator % denominator; return remainder === 0n ? quotient : quotient + 1n; }; exports.bigIntCeilDiv = bigIntCeilDiv; //# sourceMappingURL=bigint-math.js.map