<commit_before>/** @file.cc
 * π approximation
 */
#include <iostream>
#include <random>

/** Approximate π in a number of runs.
 * @param N the number of runs
 * @param rng the random number generator used
 * @return an approximation of π
 */
double ApproximatePi(const unsigned long N, std::mt19937 &rng) {
  static std::uniform_real_distribution<double> dist(0.0, 1.0);
  unsigned long i,
                n = 0;
  double x,
         y;
  for (i = 0; i < N; i++) {
    x = dist(rng);
    y = dist(rng);
    if (x * x + y * y <= 1) {
      ++n;
    }
  }
  return 4.0 * n / N;
}

/** Main. */
int main(int argc, char *argv[]) {
  std::random_device rd;
  std::mt19937 rng(rd());
  std::cout << "π = " << ApproximatePi(10000000, rng) << std::endl;
}<commit_msg> size_t instead of unsigned long<commit_after>/** @file.cc
 * π approximation
 */
#include <iostream>
#include <random>

/** Approximate π in a number of runs.
 * @param N the number of runs
 * @param rng the random number generator used
 * @return an approximation of π
 */
double ApproximatePi(const size_t N, std::mt19937 &rng) {
  static std::uniform_real_distribution<double> dist(0.0, 1.0);
  size_t i,
         n = 0;
  double x,
         y;
  for (i = 0; i < N; i++) {
    x = dist(rng);
    y = dist(rng);
    if (x * x + y * y <= 1) {
      ++n;
    }
  }
  return 4.0 * n / N;
}

/** Main. */
int main(int argc, char *argv[]) {
  std::random_device rd;
  std::mt19937 rng(rd());
  std::cout << "π = " << ApproximatePi(10000000, rng) << std::endl;
}
{'fraction_non_alphanumeric': 0.16710526315789473, 'fraction_numerical': 0.035526315789473684, 'mean_word_length': 2.7188264058679708, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2700851', 'n_tokens_mistral': 616, 'n_tokens_neox': 563, 'n_words': 179}