Check if a number is a whole number

is_wholenumber(x, tol = .Machine$double.eps^0.5)

Arguments

x

A number

tol

A tolerance level

Value

A logical value

Examples


is_wholenumber(1)
#> [1] TRUE
is_wholenumber(1.1)
#> [1] FALSE
is_wholenumber(1L)
#> [1] TRUE