Skip to main content

Math

The Math node performs a basic arithmetic operation on two input numbers and outputs the result. Use it whenever you need to add, subtract, multiply, divide, or do other math within your flow. For example, you might multiply a viewer's cheer amount by a reward multiplier, or calculate a percentage.

Inputs

NameTypeDescription
AnumberThe first operand
BnumberThe second operand

Outputs

NameTypeDescription
ResultnumberThe result of the arithmetic operation

Configuration

  • Operation: The arithmetic operation to perform. Options:
    • + Addition
    • - Subtraction
    • * Multiplication
    • / Division
    • % Modulo (remainder)
    • ^ Exponentiation (power)

Example

A viewer cheers 500 bits and you want to convert that to a "coins" value by dividing by 10. Connect the cheer event's bits output to A, use a Number Data node set to 10 for B, and set the operation to /. The result of 50 can then be passed to a Set Variable node to update the viewer's coin balance.