Yotsuba Games
Back to Node List

Math Op

math_op

Applies a binary arithmetic operation to two numbers

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
A
a
Number
Required
1ã¤į›ŽãŽæ•°å€¤ã§ã™
B
b
Number
Required
2ã¤į›ŽãŽæ•°å€¤ã§ã™

Output Ports

NameTypeDescription
値
value
Number
č¨ˆįŽ—ã—ãŸįĩæžœãŽæ•°å€¤ã§ã™

Parameters

NameTypeDefaultRangeDescription / Options
č¨ˆįŽ—ãŽį¨ŽéĄž
op
Enum
Add—

ãŠãŽč¨ˆįŽ—ã‚’ã™ã‚‹ã‹é¸ãŗãžã™

  • čļŗã—įŽ—Add
    A と B をčļŗã—ぞす。䞋: 2 と 3 → 5
  • åŧ•ãįŽ—Subtract
    A から B をåŧ•きぞす。䞋: 5 と 2 → 3
  • æŽ›ã‘įŽ—Multiply
    A と B を掛けぞす。䞋: 4 と 3 → 12
  • å‰˛ã‚ŠįŽ—Divide
    A を B ã§å‰˛ã‚Šãžã™ã€‚äž‹: 7 と 2 → 3.5
  • 小さい斚Min
    A と B ãŽã†ãĄå°ã•ã„æ–šã‚’čŋ”しぞす
  • 大きい斚Max
    A と B ãŽã†ãĄå¤§ãã„æ–šã‚’čŋ”しぞす
  • äŊ™ã‚ŠModulo
    A を B ã§å‰˛ãŖãŸéžč˛ ãŽå‰°äŊ™ã‚’čŋ”しぞす。䞋: -7 と 3 → 2
  • ずき䚗Power
    A ぎ B äš—ã‚’čŋ”しぞす。䞋: 2 と 3 → 8

What is it for?

  • Adding two values to offset a position or strength
  • Multiplying by a factor to control intensity
  • Preparing a value for a threshold calculation or Compare
  • Combining parameters into a new value

Overview

The graph's calculator node, supporting arithmetic, min/max, modulo, and power for two numbers. It is the basic building block for numeric wiring that combines parameters into new values.

Usage tips

  • Processing waveform outputs is a common use: choose Multiply to change amplitude or Add to shift the center. For simple cases, a single remap may be easier to read.
  • Modulo makes values periodic by folding positive or negative inputs into a repeating range from 0 (inclusive) to |B| (exclusive).
  • Min / Max guarantee upper or lower bounds. For example, Max(value, 0.1) guarantees a minimum value.
  • For three or more terms or a complex expression, consolidating the calculation in expression_float usually makes the graph easier to read.

Related nodes

  • math_func — one-input functions such as absolute value, rounding, and trigonometry
  • expression_float — evaluate a complex expression in one node
  • remap / clamp — dedicated range conversion and limiting nodes
  • float_input / int_input — supply constants

Operations

  • Add
    • Addition: A + B
    • Example: inputs 2 and 3 produce 5.
  • Subtract
    • Subtraction: A - B
    • Example: inputs 5 and 2 produce 3.
  • Multiply
    • Multiplication: A * B
    • Example: inputs 4 and 3 produce 12.
  • Divide
    • Division: A / B
    • Example: inputs 7 and 2 produce 3.5.
  • Min
    • Returns the smaller input.
  • Max
    • Returns the larger input.
  • Modulo
    • Returns the Euclidean remainder in the range 0 <= result < |B|.
    • Example: inputs -7 and 3 produce 2.
  • Power
    • Exponentiation. Returns A to the power of B.
    • Example: inputs 2 and 3 produce 8.

Notes

  • Divide and Modulo produce an error when B = 0.
  • Add / Subtract / Multiply / Min / Max / Modulo preserve an Int runtime value when both inputs are Int.
  • Divide and Power may produce fractional results even when the inputs are integers.
  • You cannot connect Bool or Image; this node accepts numbers only.

Examples

  1. Add Float Input(0.25) and Float Input(0.5)
    • The result is 0.75.
    • Use this to combine offsets or correction values.
  2. Multiply the output of Noise by 0.5 with Math Op(Multiply)
    • Halves the movement range or strength.
  3. Use Math Op(Subtract) to calculate current value - threshold, then pass it to Compare
    • This works as preprocessing for a condition.
  4. Use Math Op(Max) to set a guaranteed minimum value
    • Useful for preventing values from becoming too small.
Back to Node List
Math Op — PixPipeline Node Reference