RationalPowers

com.phasmidsoftware.number.algebra.core.RationalPowers
trait RationalPowers[T]

A trait for types T that can be raised to a rational or integer power.

CONSIDER eliminating this trait.

This trait provides methods for performing operations where values of type T are raised to an exponent represented as a rational or integer. It is particularly useful in mathematical computations involving such exponentiation operations while supporting rational numbers as exponents.

Type parameters

T

the type of values that can be exponentiated

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def pow(x: T, p: Rational): Try[T]

Raises a value of type T to a rational power.

Raises a value of type T to a rational power.

Value parameters

p

the rational exponent

x

the base value of type T

Attributes

Returns

the result of raising the base x to the power p

Concrete methods

def pow(x: T, n: Int): Try[T]

Raises a value of type T to the power of an integer n.

Raises a value of type T to the power of an integer n.

Value parameters

n

the exponent to which the base value is raised

x

the base value to be raised to the power

Attributes

Returns

the result of raising x to the power n