DSchroer/dslcad

Arithmetic operators do not appear to respect order of operations

Closed this issue · 3 comments

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

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.

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