Giter VIP home page Giter VIP logo

bignumber.js-nolookahead's People

Contributors

frozeman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bignumber.js-nolookahead's Issues

Compatibility with Bignumber.js 7?

Seems like this repository at some point copied bignumber.js, which now has moved forward. Is is possible to upgrade this repository to be compatible with Bignumber.js 7?

Error: invalid BigNumber string value (arg="value", value="1e+25")

I'm not sure if this is an issue or a lack of my understanding on how bignumber works but I receive this error when I try create numbers larger than 10^19.
For example this creates the invalid BigNumber string value error:

  let wei = 1000000000000000000;
  let totalSupply = bn(10000000).times(wei); 

  it('Deploy erc20', async() => {
    token = await ERC20.new(totalSupply, "SomeToken", 18, "ST");
  });

Division is not calculated correctly

Hey @frozeman

Since this is the version that is used in web3js I'm creating the issue in here.
I have the following case.

let dividend = new BigNumber(3000000000000000000);
let divisor = new BigNumber(3702000000000000000);
dividend.div(divisor).times(divisor).toString(10);
// "2999999999999999999.98416"

image

The result should be 3000000000000000000

There is also a different case doing the same calculation. The order of operations is reverted.

let dividend = new BigNumber(3000000000000000000);
let divisor = new BigNumber(3702000000000000000);
dividend.times(divisor).div(divisor).toString(10);
// "3000000000000000000"

image

The result is indeed 3000000000000000000

Theoretically the results shouldn't differ.

Publish this package to npm

Hi,

Would it be possible to publish this package to npm?

I'm using web3js package, which in turn uses this package as a dependency, pointing directly to this repository, not an npm version.

This forces git to be installed on the CI machines and also gives no visibility on what code version is being used.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.