HaoYang670 commented on issue #1901:
URL: https://github.com/apache/arrow-rs/issues/1901#issuecomment-1158844111
Thank you @jhorstmann.
Agree with you on using `leading_zeros`, and this is also how the std
library implements:
```rust
#[inline]
pub const fn log2(self) -> u32 {
Self::BITS - 1 - self.leading_zeros()
}
```
But the corner case is what should the behavior of `log2(0)` be.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]