How do languages implement multiplication assignments under the hood?

Viewed 30

How is the *= operator implemented under the hood in languages like Python and JavaScript?

Until now I've seen operators like x += y and x *= y as mere macros for writing x = x * y/x = y + y respectively.

But apparently that is not actually what's happening. So what is?

A mod previously incorrectly labeled this question as a duplicate of this Why isn't x *= 5 + 3 equivalent to x = x * 5 + 3?. That question was about how languages handles the order of the operations (language design), this question is about how languages even implement such an operation to begin with under the hood (language implementation); this is a lower level question. They're not the same question and the most immediate answers will not be the same.

0 Answers
Related