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
The From<u16> part prevents the trait from being impl for u8. Why is that? u8 is an unsigned integer too afterall? Can we change it and allow the trait to work with u8 too?
More broadly the trait name does not seem to correlate really well with the traits it requires: Shr, BitAnd, Add. It looks a bit arbitrary.
It could be improved a bit. The trait is expected to be used for custom Big Integers implementation. Creating a BigInt for an u8 seems a bit weird, but it's true it could be a improved. As for the operations it has, they are not arbitrary, they have the ones we need to build finite fields on top of it. More could be added
in
math/src/unsigned_integer/traits.rs
The
From<u16>
part prevents the trait from being impl foru8
. Why is that?u8
is an unsigned integer too afterall? Can we change it and allow the trait to work withu8
too?More broadly the trait name does not seem to correlate really well with the traits it requires:
Shr
,BitAnd
,Add
. It looks a bit arbitrary.Also, this trait exists: https://docs.rs/num/latest/num/trait.Unsigned.html
The text was updated successfully, but these errors were encountered: