pow: Raise a Value to a Power

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

This function raises a value x to a power a. It is useful for notational purposes, clearly separting the value and power from other aspects of an equation.

Usage

1
pow(x, a)

Arguments

x

a numerical value.

a

the exponent.

Value

Returns the result of raising x to the power a.

Examples

1
2
3
4
5
6
7
8
9
x = 2^4
y = pow( 2, 4 )
x == y

# Sometimes it can be hard to determine
# what is being raised to a power
x = 2 * 13 ^ 4 / 8
# This function makes it easier to tell
x = 2 * pow( 13, 4 ) / 8

rettopnivek/utilityf documentation built on March 1, 2021, 7:05 p.m.