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

Arithmetic operators do not appear to respect order of operations #15

Closed
david-southern opened this issue Feb 20, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@david-southern
Copy link

david-southern commented Feb 20, 2023

In tinkering with a basic model, I found that:

var baseHeight = 10;
var offset = 2;
translate(z = baseHeight / 2 + offset)

Results in a translation of 2.5 (i.e. 10 / (2 + 2) ), not 7, as I would expect

I then tried this:

translate(z = (baseHeight / 2) + offset)

And that does result in a translation of 7

Build info:  DSLCAD v 0.1.0
Platform:    Windows 11
@DSchroer
Copy link
Owner

Makes sense. I think this can be classified as a bug and we can fix it up. It might break some existing code so lets do this sooner than later.

@DSchroer DSchroer added the bug Something isn't working label Feb 20, 2023
@DSchroer
Copy link
Owner

DSchroer commented Mar 2, 2023

This is now fixed in the code. Will cut a pre-release soon.

@DSchroer
Copy link
Owner

DSchroer commented Mar 3, 2023

@DSchroer DSchroer closed this as completed Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants