Multiplication
This node multiplies two numbers together and returns the product.
The Multiplication node performs mathematical multiplication with optional automatic calculation.
The Multiplication node calculates the product of two numbers (First Number × Second Number). Unlike addition and subtraction, this node supports an Auto Calculate mode, allowing it to update immediately when inputs change without waiting for a specific trigger signal.
Numbers
| Data | Description |
|---|
| First Number | The first factor. Default: 0. Must be a valid number within the allowed range. |
| Second Number | The second factor. Default: 0. Must be a valid number within the allowed range. |
Behavior
| Data | Description |
|---|
| Auto Calculate | Boolean flag (default: true). If true, the calculation runs immediately whenever First Number or Second Number changes. |
Actions
| Signal | Description |
|---|
| Do | Manually triggers the calculation. Useful if Auto Calculate is false. |
| Reset | Resets all inputs and the result to 0, and clears any errors. |
Outputs
Data
| Data | Description |
|---|
| Result | The product of the two numbers. |
Signals
| Signal | Description |
|---|
| Done | Triggered when the calculation is successfully completed and the Result output has been updated. |
| Reset Done | Triggered when the Reset action is completed. |
Usage
Auto Calculation vs. Manual Trigger
- Auto Mode (Default): Useful for reactive data flows where you want the result to update instantly as values change (e.g., calculating total price as quantity changes).
- Manual Mode (
Auto Calculate = false): Useful for performance optimization or when you want to synchronize the calculation with a specific event (e.g., only calculate when a "Submit" button is pressed).
Example Use Cases
- Price Calculation:
Quantity × Unit Price.
- Area Calculation:
Width × Height.
- Scaling: Applying a multiplier to a value (e.g.,
Base Damage × Multiplier).
- Unit Conversion: Converting units (e.g.,
Inches × 2.54 = Centimeters).
Detailed Behavior
- Validation:
- Inputs must be valid numbers.
- Inputs and Result must be within ±1,000,000,000,000.
- Auto-Update:
- If
Auto Calculate is true, setting First Number or Second Number immediately triggers calculate().
- This means the
Done signal will fire immediately after the input is set.
- Error Handling:
- Overflows (result > 1T) or Underflows (result < -1T) prevent the update and log an error.
Reset clears errors and sets values to 0.
Troubleshooting
- Unexpected Updates: If the node is updating too often, check if
Auto Calculate is enabled. Disable it if you want to control the timing manually.
- Zero Result: Remember that
0 times anything is 0. Ensure both inputs are non-zero if you expect a non-zero result.