TL;DR
I propose adding the following new operations to the Arithmetic combinator:
- Division with rounding up (modulo), for example: 3\2=2, -3\2=-2, 4\2=2, ...
- Minimum of: Every(R) MIN Every(G) = Every, Every MIN Number = Every, A MIN B = C...
- Maximum of: similar
What?
Why?
I love logic networks and would like some new updates to the combinators, too, so I can build my circuits in a new way.
New operations for Arithmetic combinator
Moderator: ickputzdirwech
- Onii-ChanFL
- Burner Inserter

- Posts: 16
- Joined: Thu Oct 24, 2024 1:54 pm
- Contact:
Re: New operations for Arithmetic combinator
All of these can be done using multiple combinators. Not sure if you already know that and just want it simplified or you don't. Anyway:
- division with rounding up (aka ceil): ceil(A/B) = (A + B-1) / B. It will require at least one extra combinator, though (the +B may be achieved by wire-summing if A and B are the same symbol). On second look, what you describe is not round up, but round away from zero (different for negative numbers). Can be done too, but would be even more annoying. Anyway, there are at least 4 rounding modes (up, down, towards zero, away from zero), so I imagine adding all of them would be kind of impractical.
- minimum: 2 decision combinators with inputs and outputs tied together: Each (R) < Each (G) -> Each (R); Each (G) < Each (R) -> Each (G)
- MIN(Each (R), Number): same as above, but replace Number with Each (G), construct Each (G) by decision combinator (empty >= 0 -> Each (R) with count = Number)
Creative use of selector combinator with sort operation might also be useful in some cases for min/max.
However, I agree that adding MIN & MAX operations would somewhat simplify the circuits.
- division with rounding up (aka ceil): ceil(A/B) = (A + B-1) / B. It will require at least one extra combinator, though (the +B may be achieved by wire-summing if A and B are the same symbol). On second look, what you describe is not round up, but round away from zero (different for negative numbers). Can be done too, but would be even more annoying. Anyway, there are at least 4 rounding modes (up, down, towards zero, away from zero), so I imagine adding all of them would be kind of impractical.
- minimum: 2 decision combinators with inputs and outputs tied together: Each (R) < Each (G) -> Each (R); Each (G) < Each (R) -> Each (G)
- MIN(Each (R), Number): same as above, but replace Number with Each (G), construct Each (G) by decision combinator (empty >= 0 -> Each (R) with count = Number)
Creative use of selector combinator with sort operation might also be useful in some cases for min/max.
However, I agree that adding MIN & MAX operations would somewhat simplify the circuits.
Re: New operations for Arithmetic combinator
+1, particularly for division-round-up. I know how to do it via the add-denominator-minus-one trick, but it would be so much more convenient not to need to.


