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
| Data | Description |
|---|---|
| First Number | The dividend (number to be divided, default: 0) |
| Second Number | The divisor (number to divide by, default: 0) |
Actions
| Signal | Description |
|---|---|
| Do | Triggers the division calculation |
Outputs
| Data | Description |
|---|---|
| Result | The quotient of the division operation |
| Signal | Description |
|---|---|
| Done | Triggered 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
- Mathematical Calculations: Ratios, percentages, and proportions
- Financial Operations: Price per unit, cost splitting, tax calculations
- Game Development: Damage calculations, experience point distribution
- Data Processing: Average calculations, normalization
- UI Layout: Proportional sizing and responsive design
Examples
| First Number | Second Number | Result |
|---|---|---|
| 10 | 2 | 5 |
| 15 | 3 | 5 |
| 7 | 2 | 3.5 |
| -8 | 4 | -2 |
| 0 | 5 | 0 |
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)