R/pow.r

Defines functions cube square

Documented in cube square

#' A square function
#'
#' takes a numeric value and squares it
#'
#' @param x A numeric value.
#' @return The square of x
#' @examples
#' square(2)
#' square(3)
#' @export



square <- function(x) {
    return(x^2)
}

#' A cube function
#'
#' takes a numeric value and cubes it
#'
#' @param  x Number to be cubed.
#' @return the cube of the input
#' @examples
#' cube(2)
#' cube(3)
#' @export

cube <- function(x) {
    return(x^3)
}
abcj123cour/dpl documentation built on Dec. 18, 2021, 9:29 p.m.