Operator: &*

operator &* { associativity left precedence }

Declarations

func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger
func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger
func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger
func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger
func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger
func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger
func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger
func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger
func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger
func &*(_: Self, rhs: Self)

Returns the product of the two given values, discarding any overflow.

The masking multiplication operator (&*) silently discards any overflow that occurs during the operation. In the following example, the product of 10 and 50 is greater than the maximum representable Int8 value, so the result is the overflowed value:

let x: Int8 = 10 &* 5
// x == 50
let y: Int8 = 10 &* 50
// y == -12 (after overflow)

Parameters: lhs: The first value to multiply. rhs: The second value to multiply.

Declaration

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

Declared In

FixedWidthInteger