paritytech / primitives

Other
33 stars 23 forks source link

Add convenience impls to uint types #31

Closed kingoflolz closed 6 years ago

kingoflolz commented 6 years ago

specifically:

Note this breaks backward compatibility because doing uint + <some number type>.into() is ambiguous, but I will be happy to make the upstream PRs to fix this as required

Also, I wonder if you know if there is an Int type somewhere by parity

jtremback commented 6 years ago

As far as I can tell, they don't do Int because Parity has no need for it, since it's not needed to evaluate EVM code. AFAIK, this package mostly exists for assembly x86 optimizations

kingoflolz commented 6 years ago

@jtremback seems like int exist in the EVM http://solidity.readthedocs.io/en/v0.4.21/types.html#integers, but maybe they do not need to use it because of 2's complement arithmetic? As long as there is no need for handling overflow or displaying the numbers, int256 and uint256 should be equivalent

kingoflolz commented 6 years ago

@tomusdrw new changes pushed

kingoflolz commented 6 years ago

@tomusdrw sorry just realized I didn't ping you when I pushed my latest changes, anyways let me know if there is anything else you would like me to change. Also curious what is the relation of the uint crate in this repo with this https://github.com/paritytech/bigint/ Thanks!

tomusdrw commented 6 years ago

@debris ping

kingoflolz commented 6 years ago

Any progress on this @tomusdrw ?