I have a form where a user inputs following fields:
F = int
f = decimal in string format ie. "2.8"
distance = integer
Static variables are:
CoC = (int)(19/1000);
int mm = 1;
How would I go about forming a following formula in MIDP1.0 that doesn't support decimals. The only problem here that I am aware of is the value of f and the outcome of all of teh below formulas, as they pretty sure will outcome to a decimal.
a = ((DD/(1+((DD*CoC*f)/(F*F))))*(mm))/1000;
b = ((DD/(1-((DD*CoC*f)/(F*F))))*(mm))/1000;
d = ((F*F)/(f*CoC)*(mm))/1000;
Is there anyone who could explain to me how to make these kind of formulas work in MIDP1.0 either here or by emailing me to firstname.lastname@example.org
Well, MathFP has a few methods called toFP() that can convert your various values into fixed point format. And it also has a bunch of arithmethic and trigonometric (like add(), mul(), div()) that you can use to implement your equations.