Skip to main content

Division

This node divides one number by another and returns the quotient.

The Division node performs mathematical division with division-by-zero protection and error handling.

The Division node takes two numeric inputs and calculates the quotient (first number divided by second number). It includes built-in protection against division by zero and validates that results stay within acceptable bounds.

Inputs

Numbers

DataDescription
First NumberThe dividend (number to be divided, default: 0)
Second NumberThe divisor (number to divide by, default: 0)

Actions

SignalDescription
DoTriggers the division calculation

Outputs

DataDescription
ResultThe quotient of the division operation
SignalDescription
DoneTriggered when the calculation is complete

Usage

The Division node is used for mathematical division operations in your application. It supports:

  • Integer and decimal number division
  • Automatic division-by-zero protection
  • Input validation and error handling
  • Range checking to prevent overflow

Example Use Cases

  1. Mathematical Calculations: Ratios, percentages, and proportions
  2. Financial Operations: Price per unit, cost splitting, tax calculations
  3. Game Development: Damage calculations, experience point distribution
  4. Data Processing: Average calculations, normalization
  5. UI Layout: Proportional sizing and responsive design

Examples

First NumberSecond NumberResult
1025
1535
723.5
-84-2
050

Error Handling

The node will log errors and not perform calculations if:

  • Either input value is not a valid number
  • The second number (divisor) is zero
  • Either input value exceeds the allowed range (-1 trillion to 1 trillion)
  • The result would be infinite or exceed the allowed range

Division by Zero Protection

The node specifically checks for division by zero and will:

  • Set an error state when the divisor is zero
  • Log an error message: "Division by zero is not allowed"
  • Not update the result output
  • Not trigger the Done signal

Mathematical Properties

  • Non-commutative: a ÷ b ≠ b ÷ a (in general)
  • Non-associative: (a ÷ b) ÷ c ≠ a ÷ (b ÷ c) (in general)
  • Identity: a ÷ 1 = a
  • Zero property: 0 ÷ a = 0 (when a ≠ 0)