Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pow2

Base 2 Power


Description

Power with base 2.

Usage

pow2(f, e)

Arguments

f

numeric vector of factors

e

numeric vector of exponents for base 2

Details

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.

Value

Returns a numeric vector computing f\,2^e.

See Also

Examples

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

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.