CanMultiplyAndDivide

com.phasmidsoftware.number.algebra.core.CanMultiplyAndDivide
trait CanMultiplyAndDivide[T <: Structure] extends CanMultiply[T, T]

Represents a trait that extends the functionalities of CanMultiply to support both multiplication and division operations within an algebraic structure for types T and U.

This trait builds upon the CanMultiply trait by introducing additional properties and utilities to work within a multiplicative framework. The primary addition is the inclusion of the multiplicative identity element for types that support multiplication.

Type parameters

T

the primary type of the structure that supports multiplication and division, constrained to extend Structure and requiring a ClassTag for runtime type resolution

Attributes

Graph
Supertypes
trait CanMultiply[T, T]
trait Can[T]
class Object
trait Matchable
class Any
Known subtypes
class Real

Members list

Value members

Concrete methods

def /(that: T)(using MultiplicativeGroup[T]): T

Divides the current instance by the given value that within the context of a MultiplicativeGroup[T].

Divides the current instance by the given value that within the context of a MultiplicativeGroup[T].

Value parameters

that

the value by which the current instance is to be divided, belonging to type T

Attributes

Returns

the result of the division, computed as per the rules defined by the MultiplicativeGroup[T]

def reciprocal(using MultiplicativeGroup[T]): T

Calculates the reciprocal of the given value t within the context of a multiplicative group.

Calculates the reciprocal of the given value t within the context of a multiplicative group.

Value parameters

using

the value of MultiplicativeGroup

Attributes

Returns

the reciprocal of the given value t, computed within the rules of the provided MultiplicativeGroup[T]

Inherited methods

def *(that: T)(using MultiplicativeMonoid[T]): T

Multiplies the current instance of type T with another instance of type T, using the provided MultiplicativeMonoid context.

Multiplies the current instance of type T with another instance of type T, using the provided MultiplicativeMonoid context.

Value parameters

that

the instance of type T to be multiplied with the current instance.

Attributes

Returns

the result of multiplying the current instance by the given instance of type T.

Inherited from:
CanMultiply
def asT: T

Casts the current instance to the type parameter T of the enclosing Can trait.

Casts the current instance to the type parameter T of the enclosing Can trait.

This method performs a type-safe cast using the ClassTag to verify at runtime that the cast is valid. If the current instance cannot be cast to type T, an AlgebraException is thrown.

Attributes

Returns

the current instance as an instance of type T

Throws
AlgebraException

if the cast is invalid

Inherited from:
Can

Inherited and Abstract methods

def one: T

Returns the multiplicative identity element of type T in the context of a structure that supports multiplication.

Returns the multiplicative identity element of type T in the context of a structure that supports multiplication.

Attributes

Returns

the instance of type T that acts as the identity element for multiplication

Inherited from:
CanMultiply