% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/even_odd.r
\name{is.even}
\alias{is.even}
\alias{is.odd}
\title{Is a Number Even or Odd?}
\usage{
is.even(x, noparity.na = FALSE)

is.odd(x, noparity.na = FALSE)
}
\arguments{
\item{x}{numeric (logical, integer or double) vector.}

\item{noparity.na}{logical, whether values without parity
(e.g., \code{NA}, \code{NaN}, \code{Inf}, \code{-Inf}, and decimal numbers)
should return \code{NA} (when \code{noparity.na = TRUE}) or \code{FALSE}
(when \code{noparity.na = FALSE}).}
}
\value{
logical vector the length of \code{x}.
}
\description{
Show where a numeric input is even or odd.
}
\examples{
is.even(2)
is.odd(1)

is.even(-5:5)
is.odd(-5:5)

m <- matrix(1:4, nrow = 2, ncol = 2)
is.even(m)
is.odd(m)

# inputs without parity can be handled as NA or FALSE:
x <- c(2.0, 3.0, 2.2, 3.1, NA, Inf, -Inf, NaN)
is.even(x)
is.odd(x)
is.even(x, noparity.na = TRUE)
is.odd(x, noparity.na = TRUE)
}
