Stable lifecycle

pow(x, pow = NULL, modulus = FALSE)

Arguments

x

[univariate vector]

Univariate vector, numeric or ts object with only one dimension.

pow

[numeric(1): NA]

The nth power.

modulus

positive

Value

Returns a vector with the same class and attributes as the input vector.

Examples

pow(2, 2)
#> [1] 4
pow(-2, 2)
#> [1] 4
pow(-2,2, TRUE)
#> [1] -4