A friend of mine asked me to help him and make a small application to solve a problem. This problem can be reduced to this equation system:
aX = Yb; Y > c; Y < d; X is a whole number (X has nothing after . ); Y*10000 is a whole number (Y has no more then 4 digits after . );
eg. for a=185.5 b=1000000 c=4.3 d=4.4 a solution is X=23200 Y=4.3036
I have solved this doing this
for(i=c;i
Is there a way to solve this more efficient? (from mathematical point of view can this be solved arithmetically?)