Rounding off to the ceiling or floor value in R Programming - trunc() Function Last Updated : 01 Jun, 2020 Comments Improve Suggest changes Like Article Like Report trunc() function in R Language is used to return the largest integer that is smaller than or equal to x (i.e : rounds downs the nearest integer). trunc() function behaves as a ceiling function for negative number and floor function for positive number. Syntax: trunc(x) Parameter: x: Numeric value to be rounded off Example 1: Python3 # R program to calculate trunc value # Using trunc() method answer1 <- trunc(3.4) answer2 <- trunc(-3.4) answer3 <- trunc(3.6) answer4 <- trunc(-3.6) print(answer1) print(answer2) print(answer3) print(answer4) Output: 3 -3 3 -3 Example 2: Python3 # R program to calculate trunc value # Using trunc() method answer1 <- trunc(c(1.5, 2.6, -3, -3.4)) print(answer1) Output: 1 2 -3 -3 Comment More infoAdvertise with us Next Article Rounding off to the ceiling or floor value in R Programming - trunc() Function S spp____ Follow Improve Article Tags : R Language R Math-Function Similar Reads Rounding off a value to specific digits in R Programming - round() Function R Language provides an inbuilt function round() which rounds off to the given number of digits, if no number of digits is provided for round off, it rounds off the number to the nearest integer. Syntax: round(x, digits=n) Parameter: x: Number to be rounded off digit: Specified digits Example 1: Pyth 1 min read Compute the Value of Poisson Quantile Function in R Programming - qpois() Function qpois() function in R Language is used to compute the value of Poisson Quantile Function. It creates a quantile density plot for poisson distribution. Syntax: qpois(vec, lambda) Parameters: vec: Sequence of integer values lambda: Average number of events per interval Example 1: Python3 1== # R progr 2 min read Calculate the Floor and Ceiling values in R Programming - floor() and ceiling() Function floor() function in R Language returns the largest integer that is smaller than or equal to value passed to it as argument(i.e : rounds downs to the nearest integer). Syntax: floor(x) Parameter: x: Value to be rounded off Example 1: Python3 # R program to calculate floor value # Using floor() method 1 min read Rounding up to the Specified Number of Significant Digits in R Programming - signif() Function signif() function in R Language is used to round to the specified number of significant digits. Syntax: signif(x, digits) Parameters: x: specified number digits: significant digits Example 1: Python3 # R program to illustrate # signif function # Generating random number x <- rnorm(1) x # Calling 1 min read Rounding off values in R Language - round() Function round() function in R Language is used to round off values to a specific number of decimal value. Syntax: round(x, digits)Parameters: x: Value to be round off digits: Number of digits to which value has to be round off Example 1: Rounding off the values  Python3 # R program to illustrate # round f 1 min read Like