-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot create a Big Number #274
Comments
More details: it("has a quadrilllion (10^15) initial total supply", async () => {
const decimals = await this.token.decimals();
const totalSupply = await this.token.totalSupply();
console.log("totalSupply", totalSupply.toString());
console.log("1", 10 ** 32);
console.log("2", BN(10 ** 32).toString());
console.log("3", BN(10).exponentiatedBy(32).toString());
// console.log(new BN(expected));
// console.log((10 ** 15 * 10 ** decimals.toNumber()).toString());
// console.log(totalSupply, expected);
// expect(await this.token.totalSupply()).to.be.bignumber.equal(
// (10 ** 15 * 10 ** decimals.toNumber()).toString()
// );
});
|
you should pass the exponent number as BN object, since you try to exponent a number in plain javascript. try using example : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to create a BN object from the value
10**32
, see the following test:But it seems that the library cannot handle this
Big Number
, see the following stack trace:I also tried to initialise the
Big Number
with a string instead but the value is totally off, see:Could anyone please help?
The text was updated successfully, but these errors were encountered: