CanNegate

com.phasmidsoftware.number.algebra.core.CanNegate
trait CanNegate[T <: Structure] extends Can[T]

Attributes

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

Members list

Value members

Concrete methods

def negate(using AdditiveCommutativeGroup[T]): T

Computes the additive inverse (negation) of an instance of type T.

Computes the additive inverse (negation) of an instance of type T.

Value parameters

AdditiveCommutativeGroup[T]

an implicit instance of AdditiveCommutativeGroup for the type T, providing the necessary additive group operations.

Attributes

Returns

the negated value of the current instance as an instance of type T.

Inherited methods

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