Arithmetic Tube
Arithmetic tube is an item added by this mod. It can be placed in factory controllers to to perform arithmetic operations, such as addition, multiplication, division, rounding and trigonometry.
Arithmetic tubes primarily connect with other components via number connections. They may be used to obtain information from or control components such as factory gauges and redstone links.
Obtaining
- Cut an amethyst shard into 2 cut amethyst with a stonecutter or mechanical saw.
- Each cut amethyst can be crafted with an iron plate into an arithmetic tube.
Operating Principle
An arithmetic tube can perform various calculations depending on its selected operator. Arithmetic operators can be categorized by the number of inputs they accept, referred to as the arity.
| N-ary (accept any number of inputs) | + Sum | × Product | maxMaximum | minMinimum | |
| Binary (accept exactly 2 inputs) | - Subtract | ÷ Divide | xy Power | y√x̅ Root | logLogarithm |
| Unary (accept exactly 1 input) | | | Absolute | ⌈ ⌉ Celing | ⌊ ⌋ Floor | sgnSign | |
sinSine | cosCosine | tanTangent |
Each input corresponds to an incoming number connection, or a constant. The result is propogated to the output after 1 tick.
Numbers are 64-bit floating point values. They can represent fractional values, but their precision is limited. Slight rounding may occur during calculation. Integers outside the range ±253 may not be exact. Dividing a non-zero number by 0 results in ∞ or -∞.
Basic Configuration
- ❶ Operator selection menu
- Click to open a menu to select an arithmetic operator.
- ❷❸❹ Input entry
- Shown for each input of this arithmetic tube.
- ❷ Input source icon
- Shows the source of this input, such as the component at the other end of the number connection.
- ❸ Input value
- Shows the value of this input.
- ❹ Remove input button
- Click to remove this input.
- ❺ Result
- Shows the result of calculation.
- ❻ Relocate button
- Click to move the location of this tube on the virtual board.
- ❼ Add connection button
- Click to connect another component as an input, or to a redstone signal.
- ❽ Add constant button
- Click to add a constant.
- ❾ Confirm button
- Click to confirm settings and close this screen.
For binary operators, the 2 inputs are distinguished as primary (blue) and secondary (red) input. Their roles in relation to the operator is typically displayed in ❶. They may be swapped by clicking ❿.
Switching between operators with different arities is sometimes disallowed. In that case, remove inputs so that the number of inputs aligns with the new operator.
Constant
Clicking Figure 4 ❽ creates an editable constant as an input. On a constant input, click ❸ and type to set the constant to arbitrary values. You may enter any number in decimal, or computerized scientific notation (e.g. 1e2 for 100).
Additionally, the special constants π, τ, e, ∞ and -∞ can be entered via the ⏷ dropdown menu, or typed in their literal or English form.
Redstone
An arithmetic tube can also be connected to other components via redstone connections, such as with logical tubes and redstone links.
Redstone Input
When connected by redstone as a sink, the behaviour of the arithmetic tube when powered by redstone can be configured.
2 options can be selected by scrolling on ❶:
- Override
- When powered by redstone, override the output to the number specified in ❷.
- Hold
- When powered by redstone, hold the output at its current value.
Redstone Output
When connected by redstone as a source, the arithmetic tube can be configured to compare the numerical result with a constant, and output a redstone signal when the comparison is satisfied.
Scroll on ❶ to select a comparator (>, <, =, ≥, ≤, ≠), click ❷ to enter the number to compare to.