CanPower

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

Represents a type class for performing power operations on instances of type T.

CONSIDER two parametric types

This trait defines the behavior for raising an instance of T to a power specified by a Scalar. Implementations of this trait are responsible for defining how the power operation is computed and whether it is valid for specific inputs.

Type parameters

T

the type of the instance that supports the power operation

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait ExactNumber
class WholeNumber
class InversePower
class Real

Members list

Value members

Abstract methods

infix def pow(that: ExactNumber): Option[T]

Computes the result of raising an instance of type T to the power specified by the given ExactNumber.

Computes the result of raising an instance of type T to the power specified by the given ExactNumber.

This method performs the power operation and returns the result wrapped in an Option[T]. If the operation is invalid or cannot be performed, None is returned.

Value parameters

that

the ExactNumber exponent to which the instance is raised

Attributes

Returns

an Option[T] containing the result of the power operation if valid, or None if the operation could not be performed