The ceiling()
function returns the smallest integer that is greater than or equal to the number whose ceiling needs to be calculated.
Figure 1 shows the mathematical representation of the ceiling()
function and the corresponding expression in R.
ceiling(number)
This function requires a number to round up as a parameter.
ceiling()
returns the smallest integer that is greater than or equal to the number sent as a parameter.
#Positive numbera <- ceiling(10);print(paste0("ceiling(10): ", a))b <- ceiling(5.3);print(paste0("ceiling(5.3): ", b))#negative numberc <- ceiling(-10);print(paste0("ceiling(-10): ", c))d <- ceiling(-5.3);print(paste0("ceiling(-5.3): ", d))