<commit_before>// A little calculator test

#include <boost/algorithm/string.hpp>

using std::cout;
using std::cin;

int main()
{
  cout << "Press 1 to add, 2 to multiply, 3 to subtract, 4 to divide, or 5 to exit: ";

  int input;
  cin >> input;
  std::cin.ignore();

  if (input < 5)
    {
      // Some variable declarations
      std::string numbers_str;
      std::vector<int> numbers_int;
      std::vector<std::string> numbers_vect;
      std::string op_names[] = {"added", "multiplied", "subtracted", "divided"};

      cout << "Enter 2 or more numbers to be " << op_names[input - 1] << ": ";
      std::getline(cin, numbers_str);

      // Splits numbers_str by whitespace, then converts the string vector into an int vector
      boost::split(numbers_vect, numbers_str, boost::is_any_of("\t "));
      std::transform(begin(numbers_vect), end(numbers_vect), std::back_inserter(numbers_int), [](const std::string& val) { return std::stoi(val); });

      // The math part
      if (1 == input)
        {
          int sum = std::accumulate(numbers_int.begin(), numbers_int.end(), 0);
          cout << sum << std::endl;
        }
      else if (2 == input)
        {
          int multiply_ans = std::accumulate(numbers_int.begin(), numbers_int.end(), 1, std::multiplies<int>());
          cout << multiply_ans << std::endl;
        }
      else if (3 == input)
        {
          int subtract_ans = std::accumulate(numbers_int.begin() + 1, numbers_int.end(), numbers_int[0], std::minus<int>());
          cout << subtract_ans << std::endl;
        }
      else if (4 == input)
        {
          int division_ans = std::accumulate(numbers_int.begin() + 1, numbers_int.end(), numbers_int[0], std::divides<int>());
          cout << division_ans << std::endl;
        }
    }
  else if (5 == input)
    {
      return 0;
    }
  else
    {
      cout << "Invalid option \"" << input << "\"" << std::endl;
    }
}<commit_msg>Made a few workflow changes to calculator.cpp and added support for floating point arithmetic<commit_after>// A little calculator test

#include <boost/algorithm/string.hpp>

using std::cout;
using std::cin;

int main()
{
  while (true)
    {
      cout << "Press 1 to add, 2 to multiply, 3 to subtract, 4 to divide, or 5 to exit: ";

      int input;
      cin >> input;
      std::cin.ignore();

      if (input < 5)
        {
          // Some variable declarations
          std::string numbers_str;
          std::vector<float> numbers_float;
          std::vector<std::string> numbers_vect;
          std::string op_names[] = {"added", "multiplied", "subtracted", "divided"};

          cout << "Enter 2 or more numbers to be " << op_names[input - 1] << ": ";
          std::getline(cin, numbers_str);

          // Split numbers_str by whitespace, then converts the string vector into an int vector
          boost::split(numbers_vect, numbers_str, boost::is_any_of("\t "));
          std::transform(begin(numbers_vect), end(numbers_vect), std::back_inserter(numbers_float), [](const std::string& val) { return std::stof(val); });

          // The math part
          if (1 == input)
            {
              float sum = std::accumulate(numbers_float.begin(), numbers_float.end(), 0.0);
              cout << sum << std::endl;
              continue;
            }
          else if (2 == input)
            {
              float multiply_ans = std::accumulate(numbers_float.begin(), numbers_float.end(), 1.0, std::multiplies<float>());
              cout << multiply_ans << std::endl;
              continue;
            }
          else if (3 == input)
            {
              float subtract_ans = std::accumulate(numbers_float.begin() + 1, numbers_float.end(), numbers_float[0], std::minus<float>());
              cout << subtract_ans << std::endl;
              continue;
            }
          else if (4 == input)
            {
              float division_ans = std::accumulate(numbers_float.begin() + 1, numbers_float.end(), numbers_float[0], std::divides<float>());
              cout << division_ans << std::endl;
              continue;
            }
        }
      if (5 == input)
        {
          return 0;
        }
      else
        {
          cout << "Invalid option \"" << input << "\"" << std::endl;
          continue;
        }
    }
}
{'fraction_non_alphanumeric': 0.1489213639526792, 'fraction_numerical': 0.009742519137091163, 'mean_word_length': 2.2011878247958427, 'pattern_counts': {'":': 2, '<': 81, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '2938687', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1274, 'n_words': 333}