Operator: -=

operator -= { associativity right precedence assignment }

Declarations

func -=(_: inout Double, rhs: Double)

Subtracts the second value from the first and stores the difference in the left-hand-side variable, rounding to a representable value.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout Double, rhs: Double)
func -=(_: inout Float, rhs: Float)

Subtracts the second value from the first and stores the difference in the left-hand-side variable, rounding to a representable value.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout Float, rhs: Float)
func -=(_: inout Float80, rhs: Float80)

Subtracts the second value from the first and stores the difference in the left-hand-side variable, rounding to a representable value.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout Float80, rhs: Float80)

Declared In

Float80, BinaryFloatingPoint, Strideable
func -=(_: inout Int, rhs: Int)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout Int, rhs: Int)

Declared In

Int, FixedWidthInteger
func -=(_: inout Int8, rhs: Int8)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout Int8, rhs: Int8)

Declared In

Int8, FixedWidthInteger
func -=(_: inout Int16, rhs: Int16)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout Int16, rhs: Int16)

Declared In

Int16, FixedWidthInteger
func -=(_: inout Int32, rhs: Int32)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout Int32, rhs: Int32)

Declared In

Int32, FixedWidthInteger
func -=(_: inout Int64, rhs: Int64)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout Int64, rhs: Int64)

Declared In

Int64, FixedWidthInteger
func -=(_: inout Self, rhs: Self.Stride)

Declaration

func -=(lhs: inout Self, rhs: Self.Stride)

Declared In

Strideable
func -=(_: inout Self, rhs: Self.Stride)

Declaration

func -=(lhs: inout Self, rhs: Self.Stride)

Declared In

Strideable
func -=(_: inout Self, rhs: Self.Stride)

Declaration

func -=(lhs: inout Self, rhs: Self.Stride)

Declared In

Strideable
func -=(_: inout Self, rhs: Self.Stride)

Declaration

func -=(lhs: inout Self, rhs: Self.Stride)

Declared In

Strideable
func -=(_: inout Self, rhs: Self.Stride)

Declaration

func -=(lhs: inout Self, rhs: Self.Stride)

Declared In

Strideable
func -=(_: inout UInt, rhs: UInt)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout UInt, rhs: UInt)

Declared In

UInt, FixedWidthInteger
func -=(_: inout UInt8, rhs: UInt8)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout UInt8, rhs: UInt8)

Declared In

UInt8, FixedWidthInteger
func -=(_: inout UInt16, rhs: UInt16)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout UInt16, rhs: UInt16)

Declared In

UInt16, FixedWidthInteger
func -=(_: inout UInt32, rhs: UInt32)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout UInt32, rhs: UInt32)

Declared In

UInt32, FixedWidthInteger
func -=(_: inout UInt64, rhs: UInt64)

Subtracts the second value from the first and stores the difference in the left-hand-side variable.

The difference of the two arguments must be representable in the arguments' type. In the following example, the result of 21 - 50 is less than zero, the minimum representable UInt8 value:

var x: UInt8 = 21
x - 50
// Overflow error

Note: Overflow checking is not performed in -Ounchecked builds.

Parameters: lhs: A numeric value. rhs: The value to subtract from lhs.

Declaration

func -=(lhs: inout UInt64, rhs: UInt64)

Declared In

UInt64, FixedWidthInteger