Skip to content

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Jul 27, 2025

Fixes #31513

Description

Fix operator precedence level of / and * :

Input expression to TSL transpiler:

float r = a / b * ( c / d );
const r = a.div( b ).mul( c.div( d ) );
// old: = a.div( b.mul( c.div( d ) ) );
let r: f32 = ( a / b ) * ( c / d );
// old:    = a / ( b * ( c / d ) );

@sunag sunag added this to the r179 milestone Jul 27, 2025
@sunag sunag marked this pull request as ready for review July 27, 2025 18:52
@sunag sunag merged commit 3bd02e1 into mrdoob:dev Jul 27, 2025
8 checks passed
@sunag sunag deleted the dev-precedence branch July 27, 2025 20:54
@novogrammer
Copy link

If I’m not mistaken, * and / should have equal precedence and be left-associative (evaluated left to right).

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence

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

Successfully merging this pull request may close these issues.

Multiplicative operator precedence in TSL Transpiler
2 participants