% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/type-check-number.R
\name{check_type_number}
\alias{check_type_number}
\alias{check_number_decimal}
\alias{check_number_whole}
\title{Check argument type (numbers)}
\usage{
check_number_decimal(
  x,
  ...,
  min = NULL,
  max = NULL,
  allow_infinite = TRUE,
  allow_na = FALSE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
)

check_number_whole(
  x,
  ...,
  min = NULL,
  max = NULL,
  allow_infinite = FALSE,
  allow_na = FALSE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
)
}
\arguments{
\item{x}{The argument to check.}

\item{...}{Additional arguments passed to \code{\link[=abort]{abort()}}.}

\item{min}{Minimum value (inclusive). If \code{NULL}, no lower bound is
checked.}

\item{max}{Maximum value (inclusive). If \code{NULL}, no upper bound is
checked.}

\item{allow_infinite}{Whether infinite values are allowed.}

\item{allow_na}{Whether \code{NA} values are allowed.}

\item{allow_null}{Whether \code{NULL} is allowed.}

\item{arg}{An argument name as a string. This argument
will be mentioned in error messages as the input that is at the
origin of a problem.}

\item{call}{The execution environment of a currently
running function, e.g. \code{caller_env()}. The function will be
mentioned in error messages as the source of the error. See the
\code{call} argument of \code{\link[=abort]{abort()}} for more information.}
}
\value{
\code{NULL} invisibly if the check passes, throws an error otherwise.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}

These functions check that an argument is a number, optionally
with bounds, and produce friendly error messages otherwise.
}
\examples{
check_number_decimal(3.14)
try(check_number_decimal("x"))

check_number_whole(42)
try(check_number_whole(3.5))

}
\seealso{
Other input checkers:
\code{\link[=check_data_frame]{check_data_frame()}},
\code{\link{check_type_scalar}},
\code{\link[=stop_input_type]{stop_input_type()}}
}
\concept{input checkers}
