import BigNumber from 'bignumber.js' ; export const ZERO = new BigNumber ( '0' ) ; export const ONE = new BigNumber ( '1' ) ; /** n === 0 */ export function isZero ( n ) { return n === 0 || n === '0' || new BigNumber ( n ) . isZero ( ) ; } /** n === 1 */ export function isOne ( n ) { return n === 1 || n === '1' || new BigNumber ( n ) . isEqualTo ( ONE ) ; } /** a > b */ export function isGreaterThan ( a , b ) { return new BigNumber ( a ) . isGreaterThan ( b ) ; } /** a >= b */ export function isGreaterThanOrEqualTo ( a , b ) { return new BigNumber ( a ) . isGreaterThanOrEqualTo ( b ) ; } /** a < b */ export function isLessThan ( a , b ) { return new BigNumber ( a ) . isLessThan ( b ) ; } /** a <= b */ export function isLessThanOrEqualTo ( a , b ) { return new BigNumber ( a ) . isLessThanOrEqualTo ( b ) ; } /** a > 0 */ export function isPositive ( n ) { return new BigNumber ( n ) . isPositive ( ) ; } /** a * b */ export function multipliedBy ( a , b ) { return new BigNumber ( a ) . multipliedBy ( b ) ; } /** 10 ** n */ export function pow10 ( n ) { return new BigNumber ( 10 ) . pow ( n ) ; } /** n * (10 ** m) */ export function rightShift ( n , m ) { return new BigNumber ( n ) . shiftedBy ( + ( m ?? 0 ) ) ; } /** n / (10 ** m) */ export function leftShift ( n , m ) { return new BigNumber ( n ) . shiftedBy ( - ( m ?? 0 ) ) ; } /** a / b */ export function dividedBy ( a , b ) { return new BigNumber ( a ) . dividedBy ( b ) ; }