R/is.wholenumber.R

Defines functions is.wholenumber

Documented in is.wholenumber

#' Utility function to check if a number is a whole number
#'
#' @param x The number to check
#' @param tol The tolerance
#'
#' @return Boolean stating whether x is a whole number

is.wholenumber <- function(x, tol = .Machine$double.eps^0.5) {
  abs(x - round(x)) < tol
}
kkbrum/PSMOptimalCalipers documentation built on Dec. 21, 2021, 6:45 a.m.