OpenSCAD User Manual's section on operators does not mention precedence. Quick Web searches found nothing. I assume the usual order of exponentiation, then multiplication, then addition does hold, but how does e.g. a conditional operator or unary minus interact with these? Is there an official document describing the precedence of operators in OpenSCAD?

  • $\begingroup$ I'm not sure if/where it's documented but I think largely they follow C or C++ precedent for precedence. $\endgroup$ Sep 28 at 2:12
  • 1
    $\begingroup$ If you aren't sure, use parenthesis to force precedence. $\endgroup$
    – 0scar
    Sep 28 at 11:39
  • $\begingroup$ @0scar That's what I'm doing, but it would be nice to know. $\endgroup$
    – user31389
    Sep 28 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.