Learn R Programming

powerplus (version 1.0)

explus: Scalar Exponentiation

Description

Raises any base (real or complex) to any real power.

Usage

explus(a, numer, denom = 1)

Arguments

a
any base (real or complex)
numer
numerator of (rational) exponent. Can be a decimal number.
denom
denominator of rational exponent (1 by default)

Value

The solution to the exponentiation operation supplied. Returns a real-valued root whenever possible. Otherwise, the principal complex root.

Examples

Run this code
explus(-3, 4, 2)
explus(-3, 2, 4)
explus(-3, 2, 3)
explus(-3, 5, 3)
explus(-3, 5, 2)
explus(-3, -2, 4)
explus(0-0.5773503i, 2)
explus(-0.4, pi)
explus(-0.37, 0.2)
explus(-0.37, 1, 5)

Run the code above in your browser using DataLab