Skip to content
Snippets Groups Projects
Commit 98b34d7e authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

some condition needed to preclude endless loop

parent fb5d5888
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,8 @@ void CAxis::set_rounded_limits( double _inf, double _sup )
if(sup<0 && sup2>0) sup2 = 0;
if(inf2<0 && inf>0) inf2 = 0;
mydigits += 0.5;
} while (!((inf2<inf) && (sup<sup2)));
printf("DEB [%g,%g] -> [%g,%g] (%g)\n", inf, sup, inf2, sup2, mydigits);
} while ( !((inf2<inf) && (sup<sup2)) && mydigits<18 );
} else { // log limits
double ratio = sup / inf;
double margin = exp( relmargin*log(ratio) );
......@@ -174,7 +175,7 @@ void CAxis::set_rounded_limits( double _inf, double _sup )
sup2 = triv::round_decimal( sup*margin, mydigits );
inf2 = triv::round_decimal( inf/margin, mydigits );
mydigits += 0.5;
} while ( !((inf2<inf) && (sup<sup2)) );
} while ( !((inf2<inf) && (sup<sup2)) && mydigits<18 );
}
set_limits( inf2, sup2 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment