From Jason Turner

[bit.count]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpt08_b8dz/{from.md → to.md} +64 -0
tmp/tmpt08_b8dz/{from.md → to.md} RENAMED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Counting <a id="bit.count">[[bit.count]]</a>
2
+
3
+ In the following descriptions, let `N` denote
4
+ `numeric_limits<T>::digits`.
5
+
6
+ ``` cpp
7
+ template<class T>
8
+ constexpr int countl_zero(T x) noexcept;
9
+ ```
10
+
11
+ *Constraints:* `T` is an unsigned integer type [[basic.fundamental]].
12
+
13
+ *Returns:* The number of consecutive `0` bits in the value of `x`,
14
+ starting from the most significant bit.
15
+
16
+ [*Note 1*: Returns `N` if `x == 0`. — *end note*]
17
+
18
+ ``` cpp
19
+ template<class T>
20
+ constexpr int countl_one(T x) noexcept;
21
+ ```
22
+
23
+ *Constraints:* `T` is an unsigned integer type [[basic.fundamental]].
24
+
25
+ *Returns:* The number of consecutive `1` bits in the value of `x`,
26
+ starting from the most significant bit.
27
+
28
+ [*Note 2*: Returns `N` if
29
+ `x == numeric_limits<T>::max()`. — *end note*]
30
+
31
+ ``` cpp
32
+ template<class T>
33
+ constexpr int countr_zero(T x) noexcept;
34
+ ```
35
+
36
+ *Constraints:* `T` is an unsigned integer type [[basic.fundamental]].
37
+
38
+ *Returns:* The number of consecutive `0` bits in the value of `x`,
39
+ starting from the least significant bit.
40
+
41
+ [*Note 3*: Returns `N` if `x == 0`. — *end note*]
42
+
43
+ ``` cpp
44
+ template<class T>
45
+ constexpr int countr_one(T x) noexcept;
46
+ ```
47
+
48
+ *Constraints:* `T` is an unsigned integer type [[basic.fundamental]].
49
+
50
+ *Returns:* The number of consecutive `1` bits in the value of `x`,
51
+ starting from the least significant bit.
52
+
53
+ [*Note 4*: Returns `N` if
54
+ `x == numeric_limits<T>::max()`. — *end note*]
55
+
56
+ ``` cpp
57
+ template<class T>
58
+ constexpr int popcount(T x) noexcept;
59
+ ```
60
+
61
+ *Constraints:* `T` is an unsigned integer type [[basic.fundamental]].
62
+
63
+ *Returns:* The number of `1` bits in the value of `x`.
64
+