Search Results

Search found 1 results on 1 pages for 'livio8495'.

Page 1/1 | 1 

  • why Floating point exception?

    - by livio8495
    I have a floating point exception, and I don't know why. the code is this: void calcola_fitness(){ vector<double> fitness; int n=nodes.size(); int e=edges.size(); int dim=feasibility.size(); int feas=(feasibility[dim-1])*100; int narchi=numarchicoll[dim-1]/e; int numero_nodi=freePathNode.size()/n; double dist_start_goal=node_dist(0,1); int i,f,t; double pathlenght=0; int siize=freePathNode.size(); for(i=0;i!=siize-1; i++){ f=freePathNode[i].getIndex(); i++; t=freePathNode[i].getIndex(); i--; pathlenght=pathlenght+node_dist(f,t); } double pathlenghtnorm=pathlenght/10*dist_start_goal; double fit=((double)numero_nodi+pathlenghtnorm+(double)narchi)*((double)feas); fitness.push_back(fit); } Could anybody help me? What's the problem? I could I solve this? thank you very much

    Read the article

1