You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uint{64, 128, 256}::full_mul should all take Into<Self> as the right hand side. The reason is that mixed type arthmetic operations are discouraged. When we get Uint64*Uint64 -> Uint128, Uint128*Uint128 -> Uint256 and Uint256*Uint256 -> Uint512 where * denotes the full multipleciation operation. Keeping Into<Self> instead of just Self makes it convenient to work with and non-breaking in the vast majority of cases.
Then we can have pretty much the same implementation for all 3 cases:
pubfnfull_mul(self,rhs:implInto<Self>) -> Uint128{let a = Uint128::from(self);let b = Uint128::from(rhs.into());
a.checked_mul(b).unwrap()}
The text was updated successfully, but these errors were encountered:
Uint{64, 128, 256}::full_mul
should all takeInto<Self>
as the right hand side. The reason is that mixed type arthmetic operations are discouraged. When we getUint64*Uint64 -> Uint128
,Uint128*Uint128 -> Uint256
andUint256*Uint256 -> Uint512
where*
denotes the full multipleciation operation. KeepingInto<Self>
instead of justSelf
makes it convenient to work with and non-breaking in the vast majority of cases.Then we can have pretty much the same implementation for all 3 cases:
The text was updated successfully, but these errors were encountered: