Skip to content

FixedNumber.toHexString gives incorrect results for negative numbers #2720

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

You must be logged in to vote

FixedNumber returns the normalized 2’s compliment value, for its width, that is compatible with the decimal types in Solidity, Vyper, etc.

BigNumber does not support this implicitly, because a BigNumber doesn’t have a known width to sign extend to.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@abazlinton
Comment options

@ricmoo
Comment options

@abazlinton
Comment options

Answer selected by abazlinton
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
Converted from issue

This discussion was converted from issue #2719 on February 20, 2022 21:53.