solidity-arithmetic icon indicating copy to clipboard operation
solidity-arithmetic copied to clipboard

return wrong value

Open yonggewang opened this issue 4 years ago • 1 comments

for the

function div256_128By256(uint a21, uint a0, uint b) public pure returns (uint q, uint r)

If we we b=2^128, a0=0, a21=2^128

then the output is: q= 2^129 . I think the output should be 2^128

yonggewang avatar Nov 14 '20 15:11 yonggewang

Yeah, output should be 2^128, this library is broken 😱

Edit: Also should note that I didn't actually confirm this, but for the time being I'm taking on good faith that this report is accurate right now.

cag avatar Dec 17 '20 02:12 cag