R/kmdoubleequal.R

Defines functions kmdoubleequal

Documented in kmdoubleequal

#' Test two double numbers on equity with a certain tolerance
#'
#' @param x First double to compare
#' @param y Second double to compare
#' @param tol Tolerance optional)
#' @return Boolean for (approximate) equity
#'
#' @examples
#' kmdoubleequal(0.5+0.5, 1)
#'
#' @family Utilities
#'
#' @export
kmdoubleequal <- function(x, y, tol = sqrt(.Machine$double.eps)){
  abs(x - y) < tol
}

Try the kstMatrix package in your browser

Any scripts or data that you put into this service are public.

kstMatrix documentation built on Dec. 18, 2025, 5:07 p.m.