Floor
This node rounds a number down to the nearest integer.
The Floor node applies the mathematical floor function to round numbers downward.
The Floor node takes a numeric input and returns the largest integer less than or equal to the input value. This is useful for rounding down decimal numbers to whole numbers.
Inputs
Input
| Data | Description |
|---|---|
| Value | The number to round down (default: 0) |
Actions
| Signal | Description |
|---|---|
| Do | Triggers the floor calculation |
Outputs
| Data | Description |
|---|---|
| Floor Value | The input value rounded down to the nearest integer |
| Signal | Description |
|---|---|
| Done | Triggered when the calculation is complete |
Usage
The Floor node is essential for mathematical operations that require downward rounding:
- Always rounds toward negative infinity
- Converts decimal numbers to integers
- Handles both positive and negative numbers
- Includes input validation and error handling
Example Use Cases
- Index Calculations: Convert floating-point positions to array indices
- Grid Systems: Calculate grid coordinates from pixel positions
- Pagination: Determine page numbers from item counts
- Game Development: Convert continuous values to discrete steps
Examples
| Input | Output |
|---|---|
| 4.2 | 4 |
| 4.8 | 4 |
| 4.0 | 4 |
| -2.3 | -3 |
| -2.8 | -3 |
Error Handling
The node will log errors and not perform calculations if:
- Input value is not a valid number
- Input value exceeds the allowed range (-1 trillion to 1 trillion)
- The result would exceed the allowed range