Adds in the modulo operator to the circuit arithmetic component. (#88253)

## About The Pull Request


![image](https://github.com/user-attachments/assets/17a5d230-c10f-4fda-b782-0d59c2797bff)
This PR just adds in modulo to the circuit arithmetic component.

## Why It's Good For The Game

You _can_ calculate it yourself, but then it ends up extremely unoptimal
and you're usually better off not doing it. It also ends up really hard
to read.
I want to see more clever circuits and computing things.

## Changelog
🆑
add: Added in the modulo operator to the circuit arithmetic component.
/🆑
This commit is contained in:
CRITAWAKETS
2024-11-29 04:28:18 +01:00
committed by GitHub
parent 36ee0a4750
commit 36212e59e1
@@ -2,6 +2,7 @@
#define COMP_ARITHMETIC_SUBTRACT "Subtract"
#define COMP_ARITHMETIC_MULTIPLY "Multiply"
#define COMP_ARITHMETIC_DIVIDE "Divide"
#define COMP_ARITHMETIC_MODULO "Modulo"
#define COMP_ARITHMETIC_MIN "Minimum"
#define COMP_ARITHMETIC_MAX "Maximum"
@@ -34,6 +35,7 @@
COMP_ARITHMETIC_SUBTRACT,
COMP_ARITHMETIC_MULTIPLY,
COMP_ARITHMETIC_DIVIDE,
COMP_ARITHMETIC_MODULO,
COMP_ARITHMETIC_MIN,
COMP_ARITHMETIC_MAX,
)
@@ -75,6 +77,8 @@
result = null
break
result /= value
if(COMP_ARITHMETIC_MODULO)
result %= value
if(COMP_ARITHMETIC_MAX)
result = max(result, value)
if(COMP_ARITHMETIC_MIN)
@@ -86,5 +90,6 @@
#undef COMP_ARITHMETIC_SUBTRACT
#undef COMP_ARITHMETIC_MULTIPLY
#undef COMP_ARITHMETIC_DIVIDE
#undef COMP_ARITHMETIC_MODULO
#undef COMP_ARITHMETIC_MIN
#undef COMP_ARITHMETIC_MAX