pow2 | R Documentation |
Power with base 2.
pow2(f, e)
f |
numeric vector of factors |
e |
numeric vector of exponents for base 2 |
Computes the expression f * 2^e
, setting e
to f
and f
to 1 in case e
is missing.
Complex values are only processed if e
is missing.
Returns a numeric vector computing f\,2^e
.
nextpow2
pow2(c(0, 1, 2, 3)) #=> 1 2 4 8
pow2(c(0, -1, 2, 3), c(0,1,-2,3)) #=> 0.0 -2.0 0.5 24.0
pow2(1i) #=> 0.7692389+0.6389613i
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.