Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@ddn/bignum-utils

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ddn/bignum-utils

bignumber utils

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
9
125%
Maintainers
4
Weekly downloads
 
Created
Source

方法:

/**
 * 实例化一个大数
 */
new(num | string | BigNumber)

/**
 * 加法操作
 */
plus(num | string | BigNumber, ...args)

/**
 * 减法操作
 */
minus(num | string | BigNumber, ...args)

/**
 * 乘法操作
 */
multiply(num | string | BigNumber, ...args) {

/**
 * 除法操作
 */
divide(num | string | BigNumber, ...args)

/**
 * 非数值判断
 */
isNaN(num | string | BigNumber) {

/**
 * 零判断
 */
isZero(num | string | BigNumber)

/**
 * 相等判断
 */
isEqualTo(num | string | BigNumber, num | string | BigNumber)

/**
 * 大于判断
 */
isGreaterThan(num | string | BigNumber, num | string | BigNumber)

/**
 * 大于等于判断
 */
isGreaterThanOrEqualTo(num | string | BigNumber, num | string | BigNumber)

/**
 * 小于判断
 */
isLessThan(num | string | BigNumber, num | string | BigNumber)

/**
 * 小于等于判断
 */
isLessThanOrEqualTo(num | string | BigNumber, num | string | BigNumber)

/**
 * 绝对值
 */
abs(num | string | BigNumber)

/**
 * 取模
 */
modulo(num | string | BigNumber, num | string | BigNumber)

/**
 * 最接近的较小整数
 */
floor(num | string | BigNumber)

/**
 * 最接近的较大整数
 */
ceil(num | string | BigNumber)

/**
 * 乘方 POW
 * 返回bigNumber对象
 */
pow(num | string | BigNumber, num | string | BigNumber)

/**
 * 将byte数组转成16进制大数值
 */
fromBuffer(buf, opts)

Keywords

bignumber

FAQs

Package last updated on 16 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts