Rev 286 | Rev 7496 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{Arithmetic}\title{Arithmetic Operators}\usage{x + yx - yx * yx / yx ^ yx \%\% yx \%/\% y}\alias{+}\alias{-}\alias{*}\alias{/}\alias{^}\alias{\%\%}\alias{\%/\%}\alias{Arithmetic}\description{These binary operators perform arithmetic on vector objects.}\value{They return numeric vectors containing the result of the elementby element operations. The elements of shorter vectors are recycledas necessary. The operators are \code{+} for addition, \code{-} forsubtraction \code{*} for multiplication, \code{/} for division and\code{^} for exponentiation.\code{\%\%} indicates \code{x mod y} and \code{\%/\%} indicates integerdivision. It is guaranteed that \code{x == (x \%\% y) + y * ( x \%/\% y )}unless \code{y == 0} where the result is \code{\link{NA}} or\code{\link{NaN}} (depending on the \code{\link{typeof}} of the arguments).Objects such as arrays or time-series can be operated on thisway provided they are conformable.}\seealso{\code{\link{Math}} for miscellaneous and \code{\link{Special}} for specialmathematical functions.}\examples{x <- -1:12x + 12 * x + 3x \%\% 2 #-- is periodicx \%/\% 5}\keyword{arith}