rust-num / num-traits

Numeric traits for generic mathematics in Rust
Apache License 2.0
731 stars 135 forks source link

Add leading_ones and trailing_ones to PrimInt #205

Closed clarfonthey closed 3 years ago

clarfonthey commented 3 years ago

Since this was only stabilised in 1.46.0, it falls back to a naïve version on older versions.

It seems unlikely that the version in libstd will ever be different from calling the zeros versions on !self, but for future-proofing, this defers to the libstd versions anyway.

clarfonthey commented 3 years ago

Rebased and fixed issue mentioned

clarfonthey commented 3 years ago

ping @cuviper, I think you'd be the one to merge this?

cuviper commented 3 years ago

bors r+

bors[bot] commented 3 years ago

Build succeeded: