Skip to content

Add new compound and modulo operators to E2#3633

Open
CornerPin wants to merge 2 commits into
wiremod:masterfrom
CornerPin:new-ops
Open

Add new compound and modulo operators to E2#3633
CornerPin wants to merge 2 commits into
wiremod:masterfrom
CornerPin:new-ops

Conversation

@CornerPin

Copy link
Copy Markdown
Contributor

Initially I just wanted to add %= as I found it odd that Expression 2 doesn't already have it, then I thought why not also add compound bitwise operators for completeness. Also added modular arithmetic operators for more types.

To summarize, this PR:

  • adds %=, &&=, ||=, ^^=, >>=, and <<= compound assignment operators
  • adds modular arithmetic operators to vector2, vector, vector4, angle, complex, and quaternion:
    • number % vector2
    • vector2 % number
    • vector2 % vector2
    • number % vector
    • vector % number
    • vector % vector
    • number % vector4
    • vector4 % number
    • vector4 % vector4
    • number % angle
    • angle % number
    • angle % angle
    • complex % number
    • quaternion % number
  • renames NodeVariant.CompoundArithmetic to NodeVariant.CompoundAssignment
  • adds tests for the new operators.

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.

1 participant