Skip to content

Commit

Permalink
Correct some code snippets.
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Jan 23, 2018
1 parent a3eb861 commit 80a43c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

// chapter03_02-002_fixed_size_integer.cpp
// chapter03_02-002_prime_number.cpp

#include <cstdint>
#include <iostream>

// Initialize the 79,000th prime number.
// Initialize the 664,999th prime number.
// Macros like UINT32_C() are portable.

constexpr std::uint32_t prime_79000 = UINT32_C(10'006'721);
constexpr std::uint32_t prime_664999 = UINT32_C(10'006'721);

int main()
{
std::cout << prime_79000 << std::endl;
std::cout << prime_664999 << std::endl;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

// chapter03_02-002a_explore_prime_numbers.cpp

// In this code snippet, we explore the calculation
// of the prime numbers up to and including 10,006,721.
// A sieve method is used.

namespace
{
template<typename unsigned_integral_type = std::uint32_t,
Expand Down

0 comments on commit 80a43c6

Please sign in to comment.