#include #include #include #include #include "Element.h" using namespace std; // For now just a list with elements and their atomic weight double integer_maker(const vector& coefs) { cout << "Started Integer Maker" << endl; int i = 1; bool isGood = false; for(auto &x : coefs) { cout << "Initial check if ints" << endl; double intpart = 0.0; if(modf(x, &intpart) != 0.0) { isGood = false; break; } isGood = true; } if(!isGood) { cout << "So they're not ints. Starting algorithm to intinize them" << endl; for (i = 2; (i < 9999999) && !isGood; i++) { cout << "Outer loop for i=" << i << endl; for (auto x: coefs) { cout << "Running thru coefs for coef: " << x << endl; double y = x; double intpart; //cout << "y * i: " << y << " " << i << " " << " = " << y*i << endl; double d_val = ceil(modf(y * i, &intpart) * 10) / 10; cout << "d_val: " << d_val < elms = { {"C", 49.3}, {"H", 6.9}, {"O", 43.8} }; //Element::find_empirical(elms); vector nums = {1, 2.33}; cout << integer_maker(nums) << endl; return 0; }