KingCobra220
03-05-2006, 12:00 AM
I got two formulas, in PHP, from a friend that I want to use in Java. Here are the formulas:
x, y, and z are all doubles.
z=(pow(M_E,((x/100)-sqrt(log(y+1))))-1);
y=pow(M_E,pow((x/100)-log(z+1),2));
I tried to convert it and got this...
z = (Math.pow(Math.E,((x / 100) - Math.sqrt(Math.log(y + 1)))) - 1);
y = (Math.pow(Math.E,Math.pow((x / 100) - Math.log(z + 1),2)));
I don't get any compile errors but when I try to run some numbers through the formulas, I get one of those dos window errors (excuse the lack of proper terminology). I obviously didn't convert to Java correctly. Does anyone know how to fix my problem? Thanks a bunch.
x, y, and z are all doubles.
z=(pow(M_E,((x/100)-sqrt(log(y+1))))-1);
y=pow(M_E,pow((x/100)-log(z+1),2));
I tried to convert it and got this...
z = (Math.pow(Math.E,((x / 100) - Math.sqrt(Math.log(y + 1)))) - 1);
y = (Math.pow(Math.E,Math.pow((x / 100) - Math.log(z + 1),2)));
I don't get any compile errors but when I try to run some numbers through the formulas, I get one of those dos window errors (excuse the lack of proper terminology). I obviously didn't convert to Java correctly. Does anyone know how to fix my problem? Thanks a bunch.