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

[cppia] Wrong parentheses priority for Int32 #11897

Open
flashultra opened this issue Dec 20, 2024 · 1 comment
Open

[cppia] Wrong parentheses priority for Int32 #11897

flashultra opened this issue Dec 20, 2024 · 1 comment

Comments

@flashultra
Copy link
Contributor

The following code

var x:Int32 = 1290555;
var d:Int = -13;
x = x * (2 - (d * x));
trace("x: "+x);

will return -2147483648 (for cppia target). The correct result should be 991146299

@flashultra flashultra changed the title [cppia] Wrong Int32 operaiton [cppia] Wrong Int32 operation Dec 20, 2024
@flashultra
Copy link
Contributor Author

flashultra commented Dec 20, 2024

Something is wrong with the parentheses order.
The following works x = 2*x - x*(d * x); or x = (2 - (d * x)) * x;

@flashultra flashultra changed the title [cppia] Wrong Int32 operation [cppia] Wrong parentheses priority for Int32 Dec 20, 2024
flashultra added a commit to flashultra/haxe that referenced this issue Dec 20, 2024
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