| bc.i | R Documentation | 
The bc.i() function
performs broadcasted integer numeric operations on 2 numeric or logical arrays. 
Please note that these operations will treat the input as (double typed) integers,
and will efficiently truncate when necessary. 
Therefore, something like bc.i(1, 1.5, "==") returns TRUE,
because trunc(1.5) equals 1. 
For regular relational operators, see bc.rel. 
 
bc.i(x, y, op, ...)
## S4 method for signature 'ANY'
bc.i(x, y, op)
x, y | 
 conformable logical or numeric arrays.  | 
op | 
 a single string, giving the operator.   | 
... | 
 further arguments passed to or from methods.   | 
For arithmetic operators: 
A numeric array of whole numbers,
as a result of the broadcasted arithmetic operation. 
Base 'R' supports integers from -2^53 to 2^53,
which thus range from approximately -9 quadrillion to +9 quadrillion. 
Values outside of this range will be returned as -Inf or Inf,
as an extra protection against integer overflow. 
For relational operators: 
A logical array as a result of the broadcasted integer relational comparison. 
broadcast_operators 
x.dim <- c(4:2)
x.len <- prod(x.dim)
x.data <- sample(c(NA, 1.1:1000.1), x.len, TRUE)
x <- array(x.data, x.dim)
y <- array(1:50, c(4,1,1))
bc.i(x, y, "+")
bc.i(x, y, "-")
bc.i(x, y, "*")
bc.i(x, y, "gcd") # greatest common divisor
bc.i(x, y, "^")
bc.i(x, y, "==")
bc.i(x, y, "!=")
bc.i(x, y, "<")
bc.i(x, y, ">")
bc.i(x, y, "<=")
bc.i(x, y, ">=")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.