Skip to content

Commit 7d99b28

Browse files
authored
Unrolled build for rust-lang#139701
Rollup merge of rust-lang#139701 - Rudxain:doc-pow2, r=tgross35 docs: clarify uint exponent for `is_power_of_two` This makes the documentation more explicit for that method. I know this might seem "nit-picky", but `k` could be interpreted as "any Real or Complex number". A trivial example would be $`3 = 2^{log_2(3)}`$ which "proves that three is a power of two" (according to that vague definition). BTW, when I read the implementation, I was surprised to see that `1` is considered a power of 2 despite being odd (it does make sense in some contexts, but still not intuitive). So I wrote "positive int" before correcting it to "unsigned int"
2 parents ae06b79 + 072678e commit 7d99b28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: library/core/src/num/uint_macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3343,7 +3343,7 @@ macro_rules! uint_impl {
33433343
}
33443344
}
33453345

3346-
/// Returns `true` if and only if `self == 2^k` for some `k`.
3346+
/// Returns `true` if and only if `self == 2^k` for some unsigned integer `k`.
33473347
///
33483348
/// # Examples
33493349
///

0 commit comments

Comments
 (0)