Skip to main content

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

DataDescription
ValueThe number to round up (default: 0)

Actions

SignalDescription
DoTriggers the ceiling calculation

Outputs

DataDescription
Ceiling ValueThe input value rounded up to the nearest integer
SignalDescription
DoneTriggered 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

  1. Pagination: Calculate the number of pages needed (e.g., ceil(totalItems / itemsPerPage))
  2. Resource Allocation: Round up quantities to whole units
  3. UI Layout: Calculate minimum container sizes
  4. Game Development: Round up damage values, experience points

Examples

InputOutput
4.25
4.85
4.04
-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.