Skip to content

Why is there an underflow fault in BigNumber if value % 1 == true? #1769

Answered by ricmoo
regexyl asked this question in Q&A
Discussion options

You must be logged in to vote

Are you sure those first two are causing underflow? I can use your first two examples and they work fine. The BigNumber class does not handle e-notation (it can be confused with hex too easily, although that might be relaxed in the future).

The underflow error you are getting indicates you are passing 0.6931471805599453 into it, which is indeed an arithmetic underflow error. Use console.log before your calls to BigNumber.from To verify you are passing in what you think you are. Hoisting and masking might mean you are calling it with unexpected values.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ricmoo
Comment options

@regexyl
Comment options

Answer selected by regexyl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants