mercredi 9 août 2017

JAVA code in Android Studio not executing if statement

I am having a hard time in trying to figure out why the if statements in the following code are not executing properly:

double yint = -157.42;
if(copy_denominator.contains("x^"+nextBottom))yint = -1*constant / d2;

Log.d(PERIOD,"copy den: "+copy_denominator +" yint "+yint);
//the Log statement above prints out that yint = 3.0;

if(yint != -157.42)
Log.d(PERIOD,"oblique 5 "+slope+"x + "+yint);//I expect this to print to Log

if(yint == -157.42)Log.d(PERIOD,"oblique 6 "+slope+"x ");//This prints out.

I don't know why the statement: if(yint != -157.42) does not execute. I have never seen this before, could it be a bug in Android Studio.

thanks for any advice

Aucun commentaire:

Enregistrer un commentaire