Nick Fitzgerald 91af6b5122 Add edge-case examples to {count,leading,trailing}_{ones,zeros} methods
Some architectures (i386) do not define a "count leading zeros" instruction,
they define a "find first set bit" instruction (`bsf`) whose result is undefined
when given zero (ie none of the bits are set). Of this family of bitwise
operations, I always forget which of these things is potentially undefined for
zero, and I'm also not 100% sure that Rust provides a hard guarantee for the
results of these methods when given zero. So I figured there are others who have
these same uncertainties, and it would be good to resolve them and answer the
question via extending these doc examples/tests.

See https://en.wikipedia.org/wiki/Find_first_set#Hardware_support for more info
on i386 and `bsf` on zero.
2024-07-02 15:00:09 -07:00
..
2024-06-29 21:03:12 +02:00
2024-06-27 11:30:03 +02:00