Ceil
This node rounds a number up to the nearest integer.
The Ceil node applies the mathematical ceiling function to round numbers upward.
The Ceil node takes a numeric input and returns the smallest integer greater than or equal to the input value. This is useful for rounding up decimal numbers to whole numbers.
Inputs
Input
| Data | Description |
|---|---|
| Value | The number to round up (default: 0) |
Actions
| Signal | Description |
|---|---|
| Do | Triggers the ceiling calculation |
Outputs
| Data | Description |
|---|---|
| Ceiling Value | The input value rounded up to the nearest integer |
| Signal | Description |
|---|---|
| Done | Triggered when the calculation is complete |
Usage
The Ceil node is essential for mathematical operations that require upward rounding:
- Always rounds toward positive infinity
- Converts decimal numbers to integers
- Handles both positive and negative numbers
- Includes input validation and error handling
Example Use Cases
- Pagination: Calculate the number of pages needed (e.g., ceil(totalItems / itemsPerPage))
- Resource Allocation: Round up quantities to whole units
- UI Layout: Calculate minimum container sizes
- Game Development: Round up damage values, experience points
Examples
| Input | Output |
|---|---|
| 4.2 | 5 |
| 4.8 | 5 |
| 4.0 | 4 |
| -2.3 | -2 |
| -2.8 | -2 |
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
Mathematical Note
The ceiling function is the opposite of the floor function. While floor rounds down, ceiling always rounds up to the next integer, except when the input is already a whole number.