Maybe this is an idiot question but I can't figure out the problem.
Running the following code:
double num = 0.0;
double den = 0.0;
std::string line;
if (std::getline (file,line))
{
std::istringstream iss(line);
while (iss>>valueLine[j++]){} //Read and parse an entire line
for (int i = 0; i < numberOfUe; i++)
{
num = num + (valueLine[i+1]/1000);
den = den + ((valueLine[i+1]*valueLine[i+1])/1000000);
}
[...]
I obtained that ((valueLine[i+1]*valueLine[i+1])/1000000) = -1010
when valueLine[i+1] = 57314
.
Where is the error? Why I obtained a negative result? What I'm missing?