AbsoluteValuable

protocol AbsoluteValuable

A type that supports an "absolute value" function.

Inheritance Comparable, Equatable, ExpressibleByIntegerLiteral, SignedNumber View Protocol Hierarchy →
Associated Types
IntegerLiteralType
Import import Swift

Initializers

init(integerLiteral:) Required

Create an instance initialized to value.

Declaration

init(integerLiteral value: Self.IntegerLiteralType)

Declared In

ExpressibleByIntegerLiteral

Static Methods

static func abs(_:) Required

Returns the absolute value of x.

Declaration

static func abs(_ x: Self) -> Self

Instance Methods

func <(_:rhs:) Required

Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.

This function is the only requirement of the Comparable protocol. The remainder of the relational operator functions are implemented by the standard library for any type that conforms to Comparable.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func <(lhs: Self, rhs: Self) -> Bool

Declared In

Comparable
func <=(_:rhs:)

Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func <=(lhs: Self, rhs: Self) -> Bool

Declared In

Comparable
func ==(_:rhs:) Required

Returns a Boolean value indicating whether two values are equal.

Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func ==(lhs: Self, rhs: Self) -> Bool

Declared In

Equatable
func >(_:rhs:)

Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func >(lhs: Self, rhs: Self) -> Bool

Declared In

Comparable
func >=(_:rhs:)

Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func >=(lhs: Self, rhs: Self) -> Bool

Declared In

Comparable
prefix func -(_:) Required

Returns the result of negating x.

Declaration

prefix func -(x: Self) -> Self

Declared In

SignedNumber
func -(_:rhs:) Required

Returns the difference between lhs and rhs.

Declaration

func -(lhs: Self, rhs: Self) -> Self

Declared In

SignedNumber