Negatable

public protocol Negatable

Raw protocol backing the unary - operator.

On signed two's-complement integers, negating the minimum value overflows (e.g. -Int8.minValue == Int8.minValue); the operator wraps. Use checkedNegate if overflow needs to surface.

Associated Types

type Output

Methods

consuming func negate() -> Output

Returns -self.

Defined in lang/std/core/arithmetic.ks