<commit_before>// Copyright 2015 <NAME>
#include <math.h>
#include <iostream>
#include <iomanip>
using std::cout;
using std::setprecision;

int main(void) {
    float arg1, arg2;
    char oper;
    cout << "Enter a formula: ";
    std::cin >> arg1 >> oper >> arg2;
    float rslt;
    switch (oper) {
    case '+':
        rslt = arg1 + arg2;
        break;
    case '-':
        rslt = arg1 - arg2;
        break;
    case '*':
        rslt = arg1 * arg2;
        break;
    case '/':
        if (arg2 == 0.0) {
            cout << "ERRDIV0" << std::endl;
            return 2;
        }
        rslt  = arg1 / arg2;
        break;
    case '^':
        rslt = pow(arg1, arg2);
        break;
    case '%':
        rslt = arg1 % arg2;
        break;
    default:
        cout << "BADOP" << oper << std::endl;
        return 1;
    }
    cout << arg1 << ' ' << oper << ' ' << arg2
        << " = " << rslt << std::endl;
}
<commit_msg>Fix exponent op in calc.cpp<commit_after>// Copyright 2015 <NAME>
#include <math.h>
#include <iostream>
#include <iomanip>
using std::cout;
using std::setprecision;

int main(void) {
    float arg1, arg2;
    char oper;
    cout << "Enter a formula: ";
    std::cin >> arg1 >> oper >> arg2;
    float rslt;
    switch (oper) {
    case '+':
        rslt = arg1 + arg2;
        break;
    case '-':
        rslt = arg1 - arg2;
        break;
    case '*':
        rslt = arg1 * arg2;
        break;
    case '/':
        if (arg2 == 0.0) {
            cout << "ERRDIV0" << std::endl;
            return 2;
        }
        rslt  = arg1 / arg2;
        break;
    case '^':
        rslt = pow(arg1, arg2);
        break;
    case '%':
        rslt = static_cast<int>(arg1) % static_cast<int>(arg2);
        break;
    default:
        cout << "BADOP" << oper << std::endl;
        return 1;
    }
    cout << arg1 << ' ' << oper << ' ' << arg2
        << " = " << rslt << std::endl;
}

{'fraction_non_alphanumeric': 0.1673618352450469, 'fraction_numerical': 0.029197080291970802, 'mean_word_length': 1.6215846994535519, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 25, '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': '2086334', 'n_tokens_mistral': 714, 'n_tokens_neox': 679, 'n_words': 172}