Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of operations with division and parentheses #77

Open
JoakimNordstrandTE opened this issue Mar 7, 2024 · 0 comments
Open

Order of operations with division and parentheses #77

JoakimNordstrandTE opened this issue Mar 7, 2024 · 0 comments

Comments

@JoakimNordstrandTE
Copy link

When compiling this class with javac

class OrderOfOperations{
	public void trippleDiv(double x, double y, double z){
		double a = x/(y/z);
	}
}

and decompile with jd-core 1.1.3, I get

class OrderOfOperations {
  public void trippleDiv(double paramDouble1, double paramDouble2, double paramDouble3) {
    double d = paramDouble1 / paramDouble2 / paramDouble3;
  }
}

Since division is done left to right when there are no parentheses, the order is not the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant