New operations for Arithmetic combinator

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Viidi
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Thu Jun 16, 2022 8:52 pm
Contact:

New operations for Arithmetic combinator

Post 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.
User avatar
Onii-ChanFL
Burner Inserter
Burner Inserter
Posts: 16
Joined: Thu Oct 24, 2024 1:54 pm
Contact:

Re: New operations for Arithmetic combinator

Post by Onii-ChanFL »

+1
majer
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Jun 30, 2026 10:03 am
Contact:

Re: New operations for Arithmetic combinator

Post 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.
worph
Fast Inserter
Fast Inserter
Posts: 118
Joined: Thu Jun 25, 2026 2:01 pm
Contact:

Re: New operations for Arithmetic combinator

Post by worph »

+1
macdjord
Fast Inserter
Fast Inserter
Posts: 203
Joined: Fri Feb 22, 2013 4:26 am
Contact:

Re: New operations for Arithmetic combinator

Post 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.
Post Reply

Return to “Ideas and Suggestions”