Page 1 of 1

New operations for Arithmetic combinator

Posted: Wed Jun 24, 2026 11:48 am
by Viidi
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.

Re: New operations for Arithmetic combinator

Posted: Fri Jun 26, 2026 3:11 pm
by Onii-ChanFL
+1

Re: New operations for Arithmetic combinator

Posted: Tue Jun 30, 2026 10:40 am
by majer
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.

Re: New operations for Arithmetic combinator

Posted: Tue Jun 30, 2026 12:41 pm
by worph
+1

Re: New operations for Arithmetic combinator

Posted: Tue Jul 07, 2026 2:45 am
by macdjord
+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.