@@ -120,7 +120,7 @@ int main()
120120 {
121121 auto nextClosestPowerOf2 = std::bit_ceil(i);
122122 std::cout << "\nbit_ceil(0b" << std::bitset<4>(i) << ") = "
123- << "0b" << std::bitset<4>(nextClosestPowerOf2);
123+ << "0b" << std::bitset<4>(nextClosestPowerOf2);
124124 }
125125 return 0;
126126}
@@ -171,7 +171,7 @@ int main()
171171 {
172172 auto previousPowerOf2 = std::bit_floor(i);
173173 std::cout << "\nbit_floor(0b" << std::bitset<4>(i) << ") = 0b"
174- << std::bitset<4>(previousPowerOf2);
174+ << std::bitset<4>(previousPowerOf2);
175175 }
176176 return 0;
177177}
@@ -222,7 +222,7 @@ int main()
222222 for (unsigned i=0u; i <= 8u; ++i)
223223 {
224224 std::cout << "\nbit_width(" << i << ") = "
225- << std::bit_width(i);
225+ << std::bit_width(i);
226226 }
227227 return 0;
228228}
@@ -325,11 +325,11 @@ The number of consecutive bits set to one, starting from the most significant bi
325325int main()
326326{
327327 unsigned char value = 0;
328- for (unsigned char bit = 128; bit > 0; bit /= 2)
328+ for (unsigned char bit = 128; bit > 0; bit /= 2)
329329 {
330330 value |= bit;
331331 std::cout << "\ncountl_one(0b" << std::bitset<8>(value) << ") = "
332- << std::countl_one(value);
332+ << std::countl_one(value);
333333 }
334334 return 0;
335335}
@@ -381,7 +381,7 @@ int main()
381381 for (unsigned char result = 0, i = 0; i < 9; i++)
382382 {
383383 std::cout << "\ncountr_zero(0b" << std::bitset<8>(result) << ") = "
384- << std::countr_zero(result);
384+ << std::countr_zero(result);
385385 result = result == 0 ? 1 : result * 2;
386386 }
387387 return 0;
@@ -436,7 +436,7 @@ int main()
436436 {
437437 value |= bit;
438438 std::cout << "\ncountr_one(0b" << std::bitset<8>(value) << ") = "
439- << std::countr_one(value);
439+ << std::countr_one(value);
440440 }
441441 return 0;
442442}
@@ -488,7 +488,7 @@ int main()
488488 for (auto i = 0u; i < 10u; ++i)
489489 {
490490 std::cout << "has_single_bit(0b" << std::bitset<4>(i) << ") = "
491- << std::boolalpha << std::has_single_bit(i) << '\n';
491+ << std::boolalpha << std::has_single_bit(i) << '\n';
492492 }
493493 return 0;
494494}
@@ -541,7 +541,7 @@ int main()
541541 for (unsigned char value = 0; value < 16; value++)
542542 {
543543 std::cout << "\npopcount(0b" << std::bitset<4>(value) << ") = "
544- << std::popcount(value);
544+ << std::popcount(value);
545545 }
546546 return 0;
547547}
0 commit comments