Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@waves/bignumber

Package Overview
Dependencies
Maintainers
16
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waves/bignumber

Waves Library for work with Bignumber in javascript

  • 0.0.1-a6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-37.03%
Maintainers
16
Weekly downloads
 
Created
Source

@waves/bignumber

A Long class for representing a 64 bit two's-complement value.

Usage

The class is compatible with CommonJS and AMD loaders and is exposed globally as BigNumber if neither is available.

var BigNumber = require("@waves/bignumber");

var longVal = new BigNumber('121231321321321313213');

console.log(longVal.toString());
...

API

Constructor

  • new BigNumber(long: number | string | BigNumber)

Constants

  • BigNumber.MAX_VALUE: BigNumber
    Maximum signed value.

  • BigNumber.MIN_VALUE: BigNumber
    Minimum signed value.

  • BigNumber.MAX_UNSIGNED_VALUE: BigNumber
    Maximum unsigned value.

Methods

  • BigNumber#add(addend: Long | number | string): BigNumber
    Returns the sum of this and the specified Long.

  • BigNumber#div(divisor: Long | number | string): BigNumber
    Returns this Long divided by the specified.

  • BigNumber#eq(other: Long | number | string): boolean
    Tests if this Long's value equals the specified's.

  • BigNumber#gt(other: Long | number | string): boolean
    Tests if this Long's value is greater than the specified's.

  • BigNumber#gte/ge(other: Long | number | string): boolean
    Tests if this Long's value is greater than or equal the specified's.

  • BigNumber#isEven(): boolean
    Tests if this Long's value is even.

  • BigNumber#isNegative(): boolean
    Tests if this Long's value is negative.

  • BigNumber#isOdd(): boolean
    Tests if this Long's value is odd.

  • BigNumber#isPositive(): boolean
    Tests if this Long's value is positive.

  • BigNumber#isZero(): boolean
    Tests if this Long's value equals zero.

  • BigNumber#lt(other: Long | number | string): boolean
    Tests if this Long's value is less than the specified's.

  • BigNumber#lte/le(other: Long | number | string): boolean
    Tests if this Long's value is less than or equal the specified's.

  • BigNumber#mod(divisor: Long | number | string): BigNumber
    Returns this Long modulo the specified.

  • BigNumber#mul(multiplier: Long | number | string): BigNumber
    Returns the product of this and the specified Long.

  • BigNumber#toBytes(le?: boolean): number[]
    Converts this Long to its byte representation.

Building

To build an UMD bundle to dist/index.js, run:

$> npm install @waves/bignumber

Running the tests:

$> npm test

Keywords

FAQs

Package last updated on 22 May 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc