Math Operations

BlockMath

Perform addition, subtraction, multiplication, division, modulo and exponent operations.

Inputs

Value 1Required

First numeric value.

Example: 5

OperationRequired

Math operation to perform.

Options+ (addition)- (subtraction)÷ (division)× (multiplication)% (modulo)^ (exponent)
Value 2Required

Second numeric value.

Example: 3

Outputs

Result

Result of the math operation.

Example: 8

Build a bot using blocks like Math Operations

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: general_math_operations
  • Value block: it can be used directly inside expressions, e.g. "Result: " + general_math_operations(Args{...}).

Inputs

FieldInventScript nameValue
Value 1value_1e.g. "5"
Operationoperation"+ (addition)", "- (subtraction)", "÷ (division)", "× (multiplication)", "% (modulo)", "^ (exponent)"
Value 2value_2e.g. "3"

Outputs

FieldInventScript nameValue
Resultresulte.g. "8"

Example InventScript

sum := 5 + 3
send_text_message(Args{channel_id: trigger.channel_id, message_content: "Result: " + sum})

More math blocks