Interfaces

interface CarryingOp<T>

public interface CarryingOp<T> {
  func carryingAdd(y: T): (Bool, T)
  func carryingSub(y: T): (Bool, T)
  func carryingMul(y: T): (Bool, T)
  func carryingDiv(y: T): (Bool, T)
  func carryingMod(y: T): (Bool, T)
  func carryingInc(): (Bool, T)
  func carryingDec(): (Bool, T)
  func carryingNeg(): (Bool, T)
  func carryingShl(y: UInt64): (Bool, T)
  func carryingShr(y: UInt64): (Bool, T)
}

Description: Provides an interface for returning a Boolean value indicating whether truncation occurs during an integer operation and returning the operation result.

func carryingAdd(T)

func carryingAdd(y: T): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the addition operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Parameters:

  • y: T: addend

Returns:

  • (Bool, T): whether truncation occurs during the addition operation; operation result

func carryingDec()

func carryingDec(): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the auto-decrement operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Returns:

  • (Bool, T): whether truncation occurs during the auto-decrement operation; operation result

func carryingDiv(T)

func carryingDiv(y: T): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the division operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Parameters:

  • y: T: divisor

Returns:

  • (Bool, T): whether truncation occurs during the division operation; operation result

func carryingInc()

func carryingInc(): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the auto-increment operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Returns:

  • (Bool, T): whether truncation occurs during the auto-increment operation; operation result

func carryingMod(T)

func carryingMod(y: T): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the modulo operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Parameters:

  • y: T: divisor

Returns:

  • (Bool, T): whether truncation occurs during the modulo operation; operation result

func carryingMul(T)

func carryingMul(y: T): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the multiplication operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Parameters:

  • y: T: multiplier

Returns:

  • (Bool, T): whether truncation occurs during the multiplication operation; operation result

func carryingNeg()

func carryingNeg(): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the negation operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Returns:

  • (Bool, T): whether truncation occurs during the negation operation; operation result

func carryingShl(UInt64)

func carryingShl(y: UInt64): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the left shift operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, T): whether truncation occurs during the left shift operation; operation result

func carryingShr(UInt64)

func carryingShr(y: UInt64): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the right shift operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, T): whether truncation occurs during the right shift operation; operation result

func carryingSub(T)

func carryingSub(y: T): (Bool, T)

Description: Returns a tuple. The first element in the tuple indicates whether truncation occurs during the subtraction operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

Parameters:

  • y: T: subtrahend

Returns:

  • (Bool, T): whether truncation occurs during the subtraction operation; operation result

extend Int16 <: CarryingOp<Int16>

extend Int16 <: CarryingOp<Int16>

Description: Implements the CarryingOp interface for Int16.

Parent types:

func carryingAdd(Int16)

public func carryingAdd(y: Int16): (Bool, Int16)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, Int16)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(Int16)

public func carryingDiv(y: Int16): (Bool, Int16)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, Int16)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(Int16)

public func carryingMod(y: Int16): (Bool, Int16)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(Int16)

public func carryingMul(y: Int16): (Bool, Int16)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, Int16)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, Int16)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, Int16)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(Int16)

public func carryingSub(y: Int16): (Bool, Int16)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

extend Int32 <: CarryingOp<Int32>

extend Int32 <: CarryingOp<Int32>

Description: Implements the CarryingOp interface for Int32.

Parent types:

func carryingAdd(Int32)

public func carryingAdd(y: Int32): (Bool, Int32)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, Int32)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(Int32)

public func carryingDiv(y: Int32): (Bool, Int32)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, Int32)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(Int32)

public func carryingMod(y: Int32): (Bool, Int32)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(Int32)

public func carryingMul(y: Int32): (Bool, Int32)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, Int32)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, Int32)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, Int32)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(Int32)

public func carryingSub(y: Int32): (Bool, Int32)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

extend Int64 <: CarryingOp<Int64> & CarryingPow

extend Int64 <: CarryingOp<Int64> & CarryingPow

Description: Implements the CarryingOp and CarryingPow interfaces for Int64.

Parent types:

func carryingAdd(Int64)

public func carryingAdd(y: Int64): (Bool, Int64)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, Int64)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(Int64)

public func carryingDiv(y: Int64): (Bool, Int64)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, Int64)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(Int64)

public func carryingMod(y: Int64): (Bool, Int64)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(Int64)

public func carryingMul(y: Int64): (Bool, Int64)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, Int64)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingPow(UInt64)

public func carryingPow(y: UInt64): (Bool, Int64)

Description: Performs an exponentiation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, Int64)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, Int64)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(Int64)

public func carryingSub(y: Int64): (Bool, Int64)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

extend Int8 <: CarryingOp<Int8>

extend Int8 <: CarryingOp<Int8>

Description: Implements the CarryingOp interface for Int8.

Parent types:

func carryingAdd(Int8)

public func carryingAdd(y: Int8): (Bool, Int8)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, Int8)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(Int8)

public func carryingDiv(y: Int8): (Bool, Int8)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, Int8)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(Int8)

public func carryingMod(y: Int8): (Bool, Int8)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(Int8)

public func carryingMul(y: Int8): (Bool, Int8)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: Int8: multiplier

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, Int8)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, Int8)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, Int8)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(Int8)

public func carryingSub(y: Int8):(Bool, Int8)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: Int8: subtrahend

Returns:

  • (Bool, Int8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

extend IntNative <: CarryingOp<IntNative>

extend IntNative <: CarryingOp<IntNative>

Description: Implements the CarryingOp interface for IntNative.

Parent types:

func carryingAdd(IntNative)

public func carryingAdd(y: IntNative): (Bool, IntNative)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, IntNative)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(IntNative)

public func carryingDiv(y: IntNative): (Bool, IntNative)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, IntNative)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(IntNative)

public func carryingMod(y: IntNative): (Bool, IntNative)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(IntNative)

public func carryingMul(y: IntNative): (Bool, IntNative)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, IntNative)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, IntNative)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, IntNative)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(IntNative)

public func carryingSub(y: IntNative): (Bool, IntNative)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, IntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

extend UInt16 <: CarryingOp<UInt16>

extend UInt16 <: CarryingOp<UInt16>

Description: Implements the CarryingOp interface for UInt16.

Parent types:

func carryingAdd(UInt16)

public func carryingAdd(y: UInt16): (Bool, UInt16)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, UInt16)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(UInt16)

public func carryingDiv(y: UInt16): (Bool, UInt16)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, UInt16)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(UInt16)

public func carryingMod(y: UInt16): (Bool, UInt16)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(UInt16)

public func carryingMul(y: UInt16): (Bool, UInt16)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, UInt16)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, UInt16)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, UInt16)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(UInt16)

public func carryingSub(y: UInt16): (Bool, UInt16)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt16): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

extend UInt32 <: CarryingOp<UInt32>

extend UInt32 <: CarryingOp<UInt32>

Description: Implements the CarryingOp interface for UInt32.

Parent types:

func carryingAdd(UInt32)

public func carryingAdd(y: UInt32): (Bool, UInt32)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, UInt32)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(UInt32)

public func carryingDiv(y: UInt32): (Bool, UInt32)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, UInt32)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(UInt32)

public func carryingMod(y: UInt32): (Bool, UInt32)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(UInt32)

public func carryingMul(y: UInt32): (Bool, UInt32)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, UInt32)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, UInt32)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, UInt32)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(UInt32)

public func carryingSub(y: UInt32): (Bool, UInt32)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt32): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

extend UInt64 <: CarryingOp<UInt64>

extend UInt64 <: CarryingOp<UInt64>

Description: Implements the CarryingOp interface for UInt64.

Parent types:

func carryingAdd(UInt64)

public func carryingAdd(y: UInt64): (Bool, UInt64)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, UInt64)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(UInt64)

public func carryingDiv(y: UInt64): (Bool, UInt64)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, UInt64)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(UInt64)

public func carryingMod(y: UInt64): (Bool, UInt64)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(UInt64)

public func carryingMul(y: UInt64): (Bool, UInt64)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, UInt64)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, UInt64)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, UInt64)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(UInt64)

public func carryingSub(y: UInt64): (Bool, UInt64)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

extend UInt8 <: CarryingOp<UInt8>

extend UInt8 <: CarryingOp<UInt8>

Description: Implements the CarryingOp interface for UInt8.

Parent types:

func carryingAdd(UInt8)

public func carryingAdd(y: UInt8): (Bool, UInt8)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, UInt8)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(UInt8)

public func carryingDiv(y: UInt8): (Bool, UInt8)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, UInt8)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(UInt8)

public func carryingMod(y: UInt8): (Bool, UInt8)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(UInt8)

public func carryingMul(y: UInt8): (Bool, UInt8)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, UInt8)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, UInt8)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, UInt8)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(UInt8)

public func carryingSub(y: UInt8): (Bool, UInt8)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UInt8): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

extend UIntNative <: CarryingOp<UIntNative>

extend UIntNative <: CarryingOp<UIntNative>

Description: Implements the CarryingOp interface for UIntNative.

Parent types:

func carryingAdd(UIntNative)

public func carryingAdd(y: UIntNative): (Bool, UIntNative)

Description: Performs an addition operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDec()

public func carryingDec(): (Bool, UIntNative)

Description: Performs an auto-decrement operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingDiv(UIntNative)

public func carryingDiv(y: UIntNative): (Bool, UIntNative)

Description: Performs a division operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingInc()

public func carryingInc(): (Bool, UIntNative)

Description: Performs an auto-increment operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMod(UIntNative)

public func carryingMod(y: UIntNative): (Bool, UIntNative)

Description: Performs a modulo operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingMul(UIntNative)

public func carryingMul(y: UIntNative): (Bool, UIntNative)

Description: Performs a multiplication operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingNeg()

public func carryingNeg(): (Bool, UIntNative)

Description: Performs a negation operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShl(UInt64)

public func carryingShl(y: UInt64): (Bool, UIntNative)

Description: Performs a left shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingShr(UInt64)

public func carryingShr(y: UInt64): (Bool, UIntNative)

Description: Performs a right shift operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

func carryingSub(UIntNative)

public func carryingSub(y: UIntNative): (Bool, UIntNative)

Description: Performs a subtraction operation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, UIntNative): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

interface CarryingPow

public interface CarryingPow {
  func carryingPow(y: UInt64): (Bool, Int64)
}

Description: Provides an interface for exponentiation using the wrapping policy.

func carryingPow(UInt64)

func carryingPow(y: UInt64): (Bool, Int64)

Description: Performs an exponentiation using the wrapping policy.

If an overflow/underflow occurs during the operation, true and the operation result are returned. Otherwise, false and the operation result are returned.

Parameters:

Returns:

  • (Bool, Int64): a tuple. The first element in the tuple indicates whether truncation occurs during the operation. If truncation occurs, true is returned. The second element in the tuple indicates the operation result.

interface CheckedOp<T>

public interface CheckedOp<T> {
    func checkedAdd(y: T): ?T
    func checkedDec(): ?T
    func checkedDiv(y: T): ?T
    func checkedInc(): ?T
    func checkedMod(y: T): ?T
    func checkedMul(y: T): ?T
    func checkedNeg(): ?T
    func checkedShl(y: UInt64): ?T
    func checkedShr(y: UInt64): ?T
    func checkedSub(y: T): ?T
}

Description: Returns None when an overflow/underflow occurs during an integer operation.

func checkedAdd(T)

func checkedAdd(y: T): ?T

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?T.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: T: addend

Returns:

  • ?T: addition operation result

func checkedDec()

func checkedDec(): ?T

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?T.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?T: auto-decrement operation result

func checkedDiv(T)

func checkedDiv(y: T): ?T

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?T.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: T: divisor

Returns:

  • ?T: division operation result

func checkedInc()

func checkedInc(): ?T

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?T.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?T: auto-increment operation result

func checkedMod(T)

func checkedMod(y: T): ?T

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?T.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: T: divisor

Returns:

  • ?T: modulo operation result

func checkedMul(T)

func checkedMul(y: T): ?T

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?T.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: T: multiplier

Returns:

  • ?T: multiplication operation result

func checkedNeg()

func checkedNeg(): ?T

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?T.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?T: negation operation result

func checkedShl(UInt64)

func checkedShl(y: UInt64): ?T

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?T.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?T: left shift operation result

func checkedShr(UInt64)

func checkedShr(y: UInt64): ?T

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?T.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?T: right shift operation result

func checkedSub(T)

func checkedSub(y: T): ?T

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?T.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: T: subtrahend

Returns:

  • ?T: subtraction operation result

extend Int16 <: CheckedOp<Int16>

extend Int16 <: CheckedOp<Int16>

Description: Implements the CheckedOp interface for Int16.

Parent types:

func checkedAdd(Int16)

public func checkedAdd(y: Int16): ?Int16

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int16: addition operation result

func checkedDec()

public func checkedDec(): ?Int16

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int16.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int16: auto-decrement operation result

func checkedDiv(Int16)

public func checkedDiv(y: Int16): ?Int16

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int16: division operation result

func checkedInc()

public func checkedInc(): ?Int16

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int16.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int16: auto-increment operation result

func checkedMod(Int16)

public func checkedMod(y: Int16): ?Int16

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int16: modulo operation result

func checkedMul(Int16)

public func checkedMul(y: Int16): ?Int16

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int16: multiplication operation result

func checkedNeg()

public func checkedNeg(): ?Int16

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int16.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int16: negation operation result

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?Int16

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?Int16.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?Int16: left shift operation result

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?Int16

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?Int16.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?Int16: right shift operation result

func checkedSub(Int16)

public func checkedSub(y: Int16): ?Int16

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int16: subtraction operation result

extend Int32 <: CheckedOp<Int32>

extend Int32 <: CheckedOp<Int32>

Description: Implements the CheckedOp interface for Int32.

Parent types:

func checkedAdd(Int32)

public func checkedAdd(y: Int32): ?Int32

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int32: addition operation result

func checkedDec()

public func checkedDec(): ?Int32

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int32.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int32: auto-decrement operation result

func checkedDiv(Int32)

public func checkedDiv(y: Int32): ?Int32

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int32: division operation result

func checkedInc()

public func checkedInc(): ?Int32

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int32.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int32: auto-increment operation result

func checkedMod(Int32)

public func checkedMod(y: Int32): ?Int32

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int32: modulo operation result

func checkedMul(Int32)

public func checkedMul(y: Int32): ?Int32

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int32: multiplication operation result

func checkedNeg()

public func checkedNeg(): ?Int32

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int32.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int32: negation operation result

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?Int32

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?Int32.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?Int32: left shift operation result

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?Int32

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?Int32.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?Int32: right shift operation result

func checkedSub(Int32)

public func checkedSub(y: Int32): ?Int32

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int32: subtraction operation result

extend Int64 <: CheckedOp<Int64> & CheckedPow

extend Int64 <: CheckedOp<Int64> & CheckedPow

Description: Implements the CheckedOp and CheckedPow interfaces for Int64.

Parent types:

func checkedAdd(Int64)

public func checkedAdd(y: Int64): ?Int64

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int64: addition operation result

func checkedDec()

public func checkedDec(): ?Int64

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int64: auto-decrement operation result

func checkedDiv(Int64)

public func checkedDiv(y: Int64): ?Int64

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int64: division operation result

func checkedInc()

public func checkedInc(): ?Int64

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int64: auto-increment operation result

func checkedMod(Int64)

public func checkedMod(y: Int64): ?Int64

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int64: modulo operation result

func checkedMul(Int64)

public func checkedMul(y: Int64): ?Int64

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int64: multiplication operation result

func checkedNeg()

public func checkedNeg(): ?Int64

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int64: negation operation result

func checkedPow(UInt64)

public func checkedPow(y: UInt64): ?Int64

Description: Performs an exponentiation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int64: exponentiation result

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?Int64

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?Int64.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?Int64: left shift operation result

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?Int64

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?Int64.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?Int64: right shift operation result

func checkedSub(Int64)

public func checkedSub(y: Int64): ?Int64

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int64: subtraction operation result

extend Int8 <: CheckedOp<Int8>

extend Int8 <: CheckedOp<Int8>

Description: Implements the CheckedOp interface for Int8.

Parent types:

func checkedAdd(Int8)

public func checkedAdd(y: Int8): ?Int8

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int8.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int8: addition operation result

func checkedDec()

public func checkedDec(): ?Int8

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int8.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int8: auto-decrement operation result

func checkedDiv(Int8)

public func checkedDiv(y: Int8): ?Int8

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int8.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int8: division operation result

func checkedInc()

public func checkedInc(): ?Int8

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int8.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int8: auto-increment operation result

func checkedMod(Int8)

public func checkedMod(y: Int8): ?Int8

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int8.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int8: modulo operation result

func checkedMul(Int8)

public func checkedMul(y: Int8): ?Int8

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int8.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: Int8: multiplier

Returns:

  • ?Int8: multiplication operation result

func checkedNeg()

public func checkedNeg(): ?Int8

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int8.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?Int8: negation operation result

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?Int8

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?Int8.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?Int8: left shift operation result

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?Int8

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?Int8.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?Int8: right shift operation result

func checkedSub(Int8)

public func checkedSub(y: Int8): ?Int8

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int8.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: Int8: subtrahend

Returns:

  • ?Int8: subtraction operation result

extend IntNative <: CheckedOp<IntNative>

extend IntNative <: CheckedOp<IntNative>

Description: Implements the CheckedOp interface for IntNative.

Parent types:

func checkedAdd(IntNative)

public func checkedAdd(y: IntNative): ?IntNative

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?IntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func checkedDec()

public func checkedDec(): ?IntNative

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?IntNative.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?IntNative: auto-decrement operation result

func checkedDiv(IntNative)

public func checkedDiv(y: IntNative): ?IntNative

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?IntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func checkedInc()

public func checkedInc(): ?IntNative

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?IntNative.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?IntNative: auto-increment operation result

func checkedMod(IntNative)

public func checkedMod(y: IntNative): ?IntNative

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?IntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func checkedMul(IntNative)

public func checkedMul(y: IntNative): ?IntNative

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?IntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?IntNative: multiplication operation result

func checkedNeg()

public func checkedNeg(): ?IntNative

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?IntNative.None is returned. Otherwise, the operation result is returned.

Returns:

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?IntNative

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?IntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?IntNative

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?IntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func checkedSub(IntNative)

public func checkedSub(y: IntNative): ?IntNative

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?IntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

extend UInt16 <: CheckedOp<UInt16>

extend UInt16 <: CheckedOp<UInt16>

Description: Implements the CheckedOp interface for UInt16.

Parent types:

func checkedAdd(UInt16)

public func checkedAdd(y: UInt16): ?UInt16

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt16: addition operation result

func checkedDec()

public func checkedDec(): ?UInt16

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt16.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt16: auto-decrement operation result

func checkedDiv(UInt16)

public func checkedDiv(y: UInt16): ?UInt16

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt16: division operation result

func checkedInc()

public func checkedInc(): ?UInt16

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt16.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt16: auto-increment operation result

func checkedMod(UInt16)

public func checkedMod(y: UInt16): ?UInt16

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt16: modulo operation result

func checkedMul(UInt16)

public func checkedMul(y: UInt16): ?UInt16

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt16: multiplication operation result

func checkedNeg()

public func checkedNeg(): ?UInt16

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt16.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt16: negation operation result

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?UInt16

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UInt16.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?UInt16: left shift operation result

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?UInt16

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UInt16.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?UInt16: right shift operation result

func checkedSub(UInt16)

public func checkedSub(y: UInt16): ?UInt16

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt16.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt16: subtraction operation result

extend UInt32 <: CheckedOp<UInt32>

extend UInt32 <: CheckedOp<UInt32>

Description: Implements the CheckedOp interface for UInt32.

Parent types:

func checkedAdd(UInt32)

public func checkedAdd(y: UInt32): ?UInt32

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt32: addition operation result

func checkedDec()

public func checkedDec(): ?UInt32

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt32.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt32: auto-decrement operation result

func checkedDiv(UInt32)

public func checkedDiv(y: UInt32): ?UInt32

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt32: division operation result

func checkedInc()

public func checkedInc(): ?UInt32

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt32.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt32: auto-increment operation result

func checkedMod(UInt32)

public func checkedMod(y: UInt32): ?UInt32

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt32: modulo operation result

func checkedMul(UInt32)

public func checkedMul(y: UInt32): ?UInt32

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt32: multiplication operation result

func checkedNeg()

public func checkedNeg(): ?UInt32

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt32.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt32: negation operation result

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?UInt32

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UInt32.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?UInt32: left shift operation result

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?UInt32

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UInt32.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?UInt32: right shift operation result

func checkedSub(UInt32)

public func checkedSub(y: UInt32): ?UInt32

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt32.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt32: subtraction operation result

extend UInt64 <: CheckedOp<UInt64>

extend UInt64 <: CheckedOp<UInt64>

Description: Implements the CheckedOp interface for UInt64.

Parent types:

func checkedAdd(UInt64)

public func checkedAdd(y: UInt64): ?UInt64

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt64: addition operation result

func checkedDec()

public func checkedDec(): ?UInt64

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt64.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt64: auto-decrement operation result

func checkedDiv(UInt64)

public func checkedDiv(y: UInt64): ?UInt64

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt64: division operation result

func checkedInc()

public func checkedInc(): ?UInt64

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt64.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt64: auto-increment operation result

func checkedMod(UInt64)

public func checkedMod(y: UInt64): ?UInt64

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt64: modulo operation result

func checkedMul(UInt64)

public func checkedMul(y: UInt64): ?UInt64

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt64: multiplication operation result

func checkedNeg()

public func checkedNeg(): ?UInt64

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt64.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt64: negation operation result

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?UInt64

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UInt64.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?UInt64: left shift operation result

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?UInt64

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UInt64.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?UInt64: right shift operation result

func checkedSub(UInt64)

public func checkedSub(y: UInt64): ?UInt64

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt64: subtraction operation result

extend UInt8 <: CheckedOp<UInt8>

extend UInt8 <: CheckedOp<UInt8>

Description: Implements the CheckedOp interface for UInt8.

Parent types:

func checkedAdd(UInt8)

public func checkedAdd(y: UInt8): ?UInt8

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt8.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt8: addition operation result

func checkedDec()

public func checkedDec(): ?UInt8

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt8.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt8: auto-decrement operation result

func checkedDiv(UInt8)

public func checkedDiv(y: UInt8): ?UInt8

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt8.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt8: division operation result

func checkedInc()

public func checkedInc(): ?UInt8

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt8.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt8: auto-increment operation result

func checkedMod(UInt8)

public func checkedMod(y: UInt8): ?UInt8

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt8.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt8: modulo operation result

func checkedMul(UInt8)

public func checkedMul(y: UInt8): ?UInt8

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt8.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt8: multiplication operation result

func checkedNeg()

public func checkedNeg(): ?UInt8

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt8.None is returned. Otherwise, the operation result is returned.

Returns:

  • ?UInt8: negation operation result

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?UInt8

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UInt8.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?UInt8: left shift operation result

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?UInt8

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UInt8.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • ?UInt8: right shift operation result

func checkedSub(UInt8)

public func checkedSub(y: UInt8): ?UInt8

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UInt8.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?UInt8: subtraction operation result

extend UIntNative <: CheckedOp<UIntNative>

extend UIntNative <: CheckedOp<UIntNative>

Description: Implements the CheckedOp interface for UIntNative.

Parent types:

func checkedAdd(UIntNative)

public func checkedAdd(y: UIntNative): ?UIntNative

Description: Performs an addition operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func checkedDec()

public func checkedDec(): ?UIntNative

Description: Performs an auto-decrement operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Returns:

func checkedDiv(UIntNative)

public func checkedDiv(y: UIntNative): ?UIntNative

Description: Performs a division operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func checkedInc()

public func checkedInc(): ?UIntNative

Description: Performs an auto-increment operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Returns:

func checkedMod(UIntNative)

public func checkedMod(y: UIntNative): ?UIntNative

Description: Performs a modulo operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func checkedMul(UIntNative)

public func checkedMul(y: UIntNative): ?UIntNative

Description: Performs a multiplication operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func checkedNeg()

public func checkedNeg(): ?UIntNative

Description: Performs a negation operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Returns:

func checkedShl(UInt64)

public func checkedShl(y: UInt64): ?UIntNative

Description: Performs a left shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func checkedShr(UInt64)

public func checkedShr(y: UInt64): ?UIntNative

Description: Performs a right shift operation using the policy of returning an object of the Option type.

If the number of bits to shift by is greater than or equal to that of operand bits, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func checkedSub(UIntNative)

public func checkedSub(y: UIntNative): ?UIntNative

Description: Performs a subtraction operation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?UIntNative.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

interface CheckedPow

public interface CheckedPow {
    func checkedPow(y: UInt64): ?Int64
}

Description: Provides an exponentiation interface using the policy of returning an object of the Option type.

func checkedPow(UInt64)

func checkedPow(y: UInt64): ?Int64

Description: Performs an exponentiation using the policy of returning an object of the Option type.

If an overflow/underflow occurs during the operation, ?Int64.None is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • ?Int64: exponentiation result

interface SaturatingOp<T>

public interface SaturatingOp<T> {
    func saturatingAdd(y: T): T
    func saturatingDec(): T
    func saturatingDiv(y: T): T
    func saturatingInc(): T
    func saturatingMod(y: T): T
    func saturatingMul(y: T): T
    func saturatingNeg(): T
    func saturatingShl(y: UInt64): T
    func saturatingShr(y: UInt64): T
    func saturatingSub(y: T): T
}

Description: Performs saturation operation when an overflow/underflow occurs during an integer operation.

func saturatingAdd(T)

func saturatingAdd(y: T): T

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

  • y: T: addend

Returns:

  • T: addition operation result

func saturatingDec()

func saturatingDec(): T

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • T: auto-decrement operation result

func saturatingDiv(T)

func saturatingDiv(y: T): T

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

  • y: T: divisor

Returns:

  • T: division operation result

func saturatingInc()

func saturatingInc(): T

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • T: auto-increment operation result

func saturatingMod(T)

func saturatingMod(y: T): T

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

  • y: T: divisor

Returns:

  • T: modulo operation result

func saturatingMul(T)

func saturatingMul(y: T): T

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

  • y: T: multiplier

Returns:

  • T: multiplication operation result

func saturatingNeg()

func saturatingNeg(): T

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

  • T: negation operation result

func saturatingShl(UInt64)

func saturatingShl(y: UInt64): T

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • T: left shift operation result

func saturatingShr(UInt64)

func saturatingShr(y: UInt64): T

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • T: right shift operation result

func saturatingSub(T)

func saturatingSub(y: T): T

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

  • y: T: subtrahend

Returns:

  • T: subtraction operation result

extend Int16 <: SaturatingOp<Int16>

extend Int16 <: SaturatingOp<Int16>

Description: Implements the SaturatingOp interface for Int16.

Parent types:

func saturatingAdd(Int16)

public func saturatingAdd(y: Int16): Int16

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int16: addition operation result

func saturatingDec()

public func saturatingDec(): Int16

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • Int16: auto-decrement operation result

func saturatingDiv(Int16)

public func saturatingDiv(y: Int16): Int16

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: division operation result

func saturatingInc()

public func saturatingInc(): Int16

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • Int16: auto-increment operation result

func saturatingMod(Int16)

public func saturatingMod(y: Int16): Int16

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: modulo operation result

func saturatingMul(Int16)

public func saturatingMul(y: Int16): Int16

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int16: multiplication operation result

func saturatingNeg()

public func saturatingNeg(): Int16

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

  • Int16: negation operation result

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): Int16

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int16: left shift operation result

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): Int16

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int16: right shift operation result

func saturatingSub(Int16)

public func saturatingSub(y: Int16): Int16

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int16: subtraction operation result

extend Int32 <: SaturatingOp<Int32>

extend Int32 <: SaturatingOp<Int32>

Description: Implements the SaturatingOp interface for Int32.

Parent types:

func saturatingAdd(Int32)

public func saturatingAdd(y: Int32): Int32

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int32: addition operation result

func saturatingDec()

public func saturatingDec(): Int32

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • Int32: auto-decrement operation result

func saturatingDiv(Int32)

public func saturatingDiv(y: Int32): Int32

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: division operation result

func saturatingInc()

public func saturatingInc(): Int32

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • Int32: auto-increment operation result

func saturatingMod(Int32)

public func saturatingMod(y: Int32): Int32

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: modulo operation result

func saturatingMul(Int32)

public func saturatingMul(y: Int32): Int32

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int32: multiplication operation result

func saturatingNeg()

public func saturatingNeg(): Int32

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

  • Int32: negation operation result

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): Int32

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int32: left shift operation result

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): Int32

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int32: right shift operation result

func saturatingSub(Int32)

public func saturatingSub(y: Int32): Int32

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int32: subtraction operation result

extend Int64 <: SaturatingOp<Int64> & SaturatingPow

extend Int64 <: SaturatingOp<Int64> & SaturatingPow

Description: Implements the SaturatingOp and SaturatingPow interfaces for Int64.

Parent types:

func saturatingAdd(Int64)

public func saturatingAdd(y: Int64): Int64

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int64: addition operation result

func saturatingDec()

public func saturatingDec(): Int64

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • Int64: auto-decrement operation result

func saturatingDiv(Int64)

public func saturatingDiv(y: Int64): Int64

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: division operation result

func saturatingInc()

public func saturatingInc(): Int64

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • Int64: auto-increment operation result

func saturatingMod(Int64)

public func saturatingMod(y: Int64): Int64

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: modulo operation result

func saturatingMul(Int64)

public func saturatingMul(y: Int64): Int64

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int64: multiplication operation result

func saturatingNeg()

public func saturatingNeg(): Int64

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

  • Int64: negation operation result

func saturatingPow(UInt64)

public func saturatingPow(y: UInt64): Int64

Description: Performs an exponentiation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int64: exponentiation result

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): Int64

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int64: left shift operation result

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): Int64

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int64: right shift operation result

func saturatingSub(Int64)

public func saturatingSub(y: Int64): Int64

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int64: subtraction operation result

extend Int8 <: SaturatingOp<Int8>

extend Int8 <: SaturatingOp<Int8>

Description: Implements the SaturatingOp interface for Int8.

Parent types:

func saturatingAdd(Int8)

public func saturatingAdd(y: Int8): Int8

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int8: addition operation result

func saturatingDec()

public func saturatingDec(): Int8

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • Int8: auto-decrement operation result

func saturatingDiv(Int8)

public func saturatingDiv(y: Int8): Int8

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int8: division operation result

func saturatingInc()

public func saturatingInc(): Int8

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • Int8: auto-increment operation result

func saturatingMod(Int8)

public func saturatingMod(y: Int8): Int8

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int8: modulo operation result

func saturatingMul(Int8)

public func saturatingMul(y: Int8): Int8

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

  • y: Int8: multiplier

Returns:

  • Int8: multiplication operation result

func saturatingNeg()

public func saturatingNeg(): Int8

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

  • Int8: negation operation result

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): Int8

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int8: left shift operation result

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): Int8

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int8: right shift operation result

func saturatingSub(Int8)

public func saturatingSub(y: Int8): Int8

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

  • y: Int8: subtrahend

Returns:

  • Int8: subtraction operation result

extend IntNative <: SaturatingOp<IntNative>

extend IntNative <: SaturatingOp<IntNative>

Description: Implements the SaturatingOp interface for IntNative.

Parent types:

func saturatingAdd(IntNative)

public func saturatingAdd(y: IntNative): IntNative

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

func saturatingDec()

public func saturatingDec(): IntNative

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

func saturatingDiv(IntNative)

public func saturatingDiv(y: IntNative): IntNative

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func saturatingInc()

public func saturatingInc(): IntNative

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

func saturatingMod(IntNative)

public func saturatingMod(y: IntNative): IntNative

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func saturatingMul(IntNative)

public func saturatingMul(y: IntNative): IntNative

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

func saturatingNeg()

public func saturatingNeg(): IntNative

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): IntNative

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): IntNative

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func saturatingSub(IntNative)

public func saturatingSub(y: IntNative): IntNative

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

extend UInt16 <: SaturatingOp<UInt16>

extend UInt16 <: SaturatingOp<UInt16>

Description: Implements the SaturatingOp interface for UInt16.

Parent types:

func saturatingAdd(UInt16)

public func saturatingAdd(y: UInt16): UInt16

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt16: addition operation result

func saturatingDec()

public func saturatingDec(): UInt16

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • UInt16: auto-decrement operation result

func saturatingDiv(UInt16)

public func saturatingDiv(y: UInt16): UInt16

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: division operation result

func saturatingInc()

public func saturatingInc(): UInt16

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • UInt16: auto-increment operation result

func saturatingMod(UInt16)

public func saturatingMod(y: UInt16): UInt16

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: modulo operation result

func saturatingMul(UInt16)

public func saturatingMul(y: UInt16): UInt16

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt16: multiplication operation result

func saturatingNeg()

public func saturatingNeg(): UInt16

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

  • UInt16: negation operation result

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): UInt16

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt16: left shift operation result

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): UInt16

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt16: right shift operation result

func saturatingSub(UInt16)

public func saturatingSub(y: UInt16): UInt16

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt16: subtraction operation result

extend UInt32 <: SaturatingOp<UInt32>

extend UInt32 <: SaturatingOp<UInt32>

Description: Implements the SaturatingOp interface for UInt32.

Parent types:

func saturatingAdd(UInt32)

public func saturatingAdd(y: UInt32): UInt32

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt32: addition operation result

func saturatingDec()

public func saturatingDec(): UInt32

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • UInt32: auto-decrement operation result

func saturatingDiv(UInt32)

public func saturatingDiv(y: UInt32): UInt32

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: division operation result

func saturatingInc()

public func saturatingInc(): UInt32

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • UInt32: auto-increment operation result

func saturatingMod(UInt32)

public func saturatingMod(y: UInt32): UInt32

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: modulo operation result

func saturatingMul(UInt32)

public func saturatingMul(y: UInt32): UInt32

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt32: multiplication operation result

func saturatingNeg()

public func saturatingNeg(): UInt32

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

  • UInt32: negation operation result

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): UInt32

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt32: left shift operation result

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): UInt32

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt32: right shift operation result

func saturatingSub(UInt32)

public func saturatingSub(y: UInt32): UInt32

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt32: subtraction operation result

extend UInt64 <: SaturatingOp<UInt64>

extend UInt64 <: SaturatingOp<UInt64>

Description: Implements the SaturatingOp interface for UInt64.

Parent types:

func saturatingAdd(UInt64)

public func saturatingAdd(y: UInt64): UInt64

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt64: addition operation result

func saturatingDec()

public func saturatingDec(): UInt64

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • UInt64: auto-decrement operation result

func saturatingDiv(UInt64)

public func saturatingDiv(y: UInt64): UInt64

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: division operation result

func saturatingInc()

public func saturatingInc(): UInt64

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • UInt64: auto-increment operation result

func saturatingMod(UInt64)

public func saturatingMod(y: UInt64): UInt64

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: modulo operation result

func saturatingMul(UInt64)

public func saturatingMul(y: UInt64): UInt64

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt64: multiplication operation result

func saturatingNeg()

public func saturatingNeg(): UInt64

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

  • UInt64: negation operation result

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): UInt64

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt64: left shift operation result

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): UInt64

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt64: right shift operation result

func saturatingSub(UInt64)

public func saturatingSub(y: UInt64): UInt64

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt64: subtraction operation result

extend UInt8 <: SaturatingOp<UInt8>

extend UInt8 <: SaturatingOp<UInt8>

Description: Implements the SaturatingOp interface for UInt8.

Parent types:

func saturatingAdd(UInt8)

public func saturatingAdd(y: UInt8): UInt8

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt8: addition operation result

func saturatingDec()

public func saturatingDec(): UInt8

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • UInt8: auto-decrement operation result

func saturatingDiv(UInt8)

public func saturatingDiv(y: UInt8): UInt8

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: division operation result

func saturatingInc()

public func saturatingInc(): UInt8

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

  • UInt8: auto-increment operation result

func saturatingMod(UInt8)

public func saturatingMod(y: UInt8): UInt8

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: modulo operation result

func saturatingMul(UInt8)

public func saturatingMul(y: UInt8): UInt8

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt8: multiplication operation result

func saturatingNeg()

public func saturatingNeg(): UInt8

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

  • UInt8: negation operation result

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): UInt8

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt8: left shift operation result

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): UInt8

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt8: right shift operation result

func saturatingSub(UInt8)

public func saturatingSub(y: UInt8): UInt8

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • UInt8: subtraction operation result

extend UIntNative <: SaturatingOp<UIntNative>

extend UIntNative <: SaturatingOp<UIntNative>

Description: Implements the SaturatingOp interface for UIntNative.

Parent types:

func saturatingAdd(UIntNative)

public func saturatingAdd(y: UIntNative): UIntNative

Description: Performs an addition operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

func saturatingDec()

public func saturatingDec(): UIntNative

Description: Performs an auto-decrement operation using the saturation operation policy.

If an underflow occurs during the operation, the minimum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

func saturatingDiv(UIntNative)

public func saturatingDiv(y: UIntNative): UIntNative

Description: Performs a division operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func saturatingInc()

public func saturatingInc(): UIntNative

Description: Performs an auto-increment operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Returns:

func saturatingMod(UIntNative)

public func saturatingMod(y: UIntNative): UIntNative

Description: Performs a modulo operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. Otherwise, the operation result is returned.

Parameters:

Returns:

func saturatingMul(UIntNative)

public func saturatingMul(y: UIntNative): UIntNative

Description: Performs a multiplication operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

func saturatingNeg()

public func saturatingNeg(): UIntNative

Description: Performs a negation operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Returns:

func saturatingShl(UInt64)

public func saturatingShl(y: UInt64): UIntNative

Description: Performs a left shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func saturatingShr(UInt64)

public func saturatingShr(y: UInt64): UIntNative

Description: Performs a right shift operation using the saturation operation policy.

If the number of bits to shift by is greater than or equal to that of operand bits, the number of bits to shift by is set to the number of operand bits minus 1. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func saturatingSub(UIntNative)

public func saturatingSub(y: UIntNative): UIntNative

Description: Performs a subtraction operation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

interface SaturatingPow

public interface SaturatingPow {
    public func saturatingPow(y: UInt64): Int64
}

Description: Provides an interface for exponentiation using the saturation operation policy.

func saturatingPow(UInt64)

public func saturatingPow(y: UInt64): Int64

Description: Performs an exponentiation using the saturation operation policy.

If an overflow occurs during the operation, the maximum value of the operand type is returned. If an underflow occurs during the operation, the minimum value of the operand type is returned. In other cases, the operation result is returned.

Parameters:

Returns:

  • Int64: exponentiation result

interface ThrowingOp<T>

public interface ThrowingOp<T> {
    func throwingAdd(y: T): T
    func throwingSub(y: T): T
    func throwingMul(y: T): T
    func throwingDiv(y: T): T
    func throwingMod(y: T): T
    func throwingInc(): T
    func throwingDec(): T
    func throwingNeg(): T
    func throwingShl(y: UInt64): T
    func throwingShr(y: UInt64): T
}

Description: Throws an exception when an overflow/underflow occurs during an integer operation.

func throwingAdd(T)

func throwingAdd(y: T): T

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: T: addend

Returns:

  • T: addition operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

func throwingDec(): T

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • T: auto-decrement operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(T)

func throwingDiv(y: T): T

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: T: divisor

Returns:

  • T: division operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

func throwingInc(): T

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • T: auto-increment operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(T)

func throwingMod(y: T): T

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: T: divisor

Returns:

  • T: modulo operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(T)

func throwingMul(y: T): T

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: T: multiplier

Returns:

  • T: multiplication operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

func throwingNeg(): T

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • T: negation operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

func throwingShl(y: UInt64): T

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • T: left shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

func throwingShr(y: UInt64): T

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • T: right shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(T)

func throwingSub(y: T): T

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: T: subtrahend

Returns:

  • T: subtraction operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend Int16 <: ThrowingOp<Int16>

extend Int16 <: ThrowingOp<Int16>

Description: Implements the ThrowingOp interface for Int16.

Parent types:

func throwingAdd(Int16)

public func throwingAdd(y: Int16): Int16

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: addition operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): Int16

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int16: auto-decrement operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(Int16)

public func throwingDiv(y: Int16): Int16

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: division operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): Int16

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int16: auto-increment operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(Int16)

public func throwingMod(y: Int16): Int16

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: modulo operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(Int16)

public func throwingMul(y: Int16): Int16

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: multiplication operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): Int16

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int16: negation operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): Int16

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int16: left shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): Int16

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int16: right shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(Int16)

public func throwingSub(y: Int16): Int16

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: subtraction operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend Int32 <: ThrowingOp<Int32>

extend Int32 <: ThrowingOp<Int32>

Description: Implements the ThrowingOp interface for Int32.

Parent types:

func throwingAdd(Int32)

public func throwingAdd(y: Int32): Int32

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: addition operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): Int32

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int32: auto-decrement operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(Int32)

public func throwingDiv(y: Int32): Int32

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: division operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): Int32

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int32: auto-increment operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(Int32)

public func throwingMod(y: Int32): Int32

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: modulo operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(Int32)

public func throwingMul(y: Int32): Int32

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: multiplication operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): Int32

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int32: negation operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): Int32

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int32: left shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): Int32

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int32: right shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(Int32)

public func throwingSub(y: Int32): Int32

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: subtraction operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend Int64 <: ThrowingOp<Int64> & ThrowingPow

extend Int64 <: ThrowingOp<Int64> & ThrowingPow

Description: Implements the ThrowingOp and ThrowingPow interfaces for Int64.

Parent types:

func throwingAdd(Int64)

public func throwingAdd(y: Int64): Int64

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: addition operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): Int64

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int64: auto-decrement operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(Int64)

public func throwingDiv(y: Int64): Int64

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: division operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): Int64

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int64: auto-increment operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(Int64)

public func throwingMod(y: Int64): Int64

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: modulo operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(Int64)

public func throwingMul(y: Int64): Int64

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: multiplication operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): Int64

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int64: negation operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingPow(UInt64)

public func throwingPow(y: UInt64): Int64

Description: Performs an exponentiation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: exponentiation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the exponentiation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): Int64

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int64: left shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): Int64

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int64: right shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(Int64)

public func throwingSub(y: Int64): Int64

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: subtraction operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend Int8 <: ThrowingOp<Int8>

extend Int8 <: ThrowingOp<Int8>

Description: Implements the ThrowingOp interface for Int8.

Parent types:

func throwingAdd(Int8)

public func throwingAdd(y: Int8): Int8

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int8: addition operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): Int8

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int8: auto-decrement operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(Int8)

public func throwingDiv(y: Int8): Int8

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int8: division operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): Int8

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int8: auto-increment operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(Int8)

public func throwingMod(y: Int8): Int8

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int8: modulo operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(Int8)

public func throwingMul(y: Int8): Int8

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: Int8: multiplier

Returns:

  • Int8: multiplication operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): Int8

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • Int8: negation operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): Int8

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int8: left shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): Int8

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int8: right shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(Int8)

public func throwingSub(y: Int8): Int8

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: Int8: subtrahend

Returns:

  • Int8: subtraction operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend IntNative <: ThrowingOp<IntNative>

extend IntNative <: ThrowingOp<IntNative>

Description: Implements the ThrowingOp interface for IntNative.

Parent types:

func throwingAdd(IntNative)

public func throwingAdd(y: IntNative): IntNative

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): IntNative

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(IntNative)

public func throwingDiv(y: IntNative): IntNative

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): IntNative

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(IntNative)

public func throwingMod(y: IntNative): IntNative

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(IntNative)

public func throwingMul(y: IntNative): IntNative

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): IntNative

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): IntNative

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): IntNative

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(IntNative)

public func throwingSub(y: IntNative): IntNative

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend UInt16 <: ThrowingOp<UInt16>

extend UInt16 <: ThrowingOp<UInt16>

Description: Implements the ThrowingOp interface for UInt16.

Parent types:

func throwingAdd(UInt16)

public func throwingAdd(y: UInt16): UInt16

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: addition operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): UInt16

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt16: auto-decrement operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(UInt16)

public func throwingDiv(y: UInt16): UInt16

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: division operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): UInt16

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt16: auto-increment operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(UInt16)

public func throwingMod(y: UInt16): UInt16

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: modulo operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(UInt16)

public func throwingMul(y: UInt16): UInt16

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: multiplication operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): UInt16

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt16: negation operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): UInt16

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt16: left shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): UInt16

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt16: right shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(UInt16)

public func throwingSub(y: UInt16): UInt16

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: subtraction operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend UInt32 <: ThrowingOp<UInt32>

extend UInt32 <: ThrowingOp<UInt32>

Description: Implements the ThrowingOp interface for UInt32.

Parent types:

func throwingAdd(UInt32)

public func throwingAdd(y: UInt32): UInt32

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: addition operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): UInt32

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt32: auto-decrement operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(UInt32)

public func throwingDiv(y: UInt32): UInt32

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: division operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): UInt32

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt32: auto-increment operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(UInt32)

public func throwingMod(y: UInt32): UInt32

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: modulo operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(UInt32)

public func throwingMul(y: UInt32): UInt32

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: multiplication operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): UInt32

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt32: negation operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): UInt32

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt32: left shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): UInt32

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt32: right shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(UInt32)

public func throwingSub(y: UInt32): UInt32

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: subtraction operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend UInt64 <: ThrowingOp<UInt64>

extend UInt64 <: ThrowingOp<UInt64>

Description: Implements the ThrowingOp interface for UInt64.

Parent types:

func throwingAdd(UInt64)

public func throwingAdd(y: UInt64): UInt64

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: addition operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): UInt64

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt64: auto-decrement operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(UInt64)

public func throwingDiv(y: UInt64): UInt64

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: division operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): UInt64

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt64: auto-increment operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(UInt64)

public func throwingMod(y: UInt64): UInt64

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: modulo operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(UInt64)

public func throwingMul(y: UInt64): UInt64

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: multiplication operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): UInt64

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt64: negation operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): UInt64

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt64: left shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): UInt64

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt64: right shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(UInt64)

public func throwingSub(y: UInt64): UInt64

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: subtraction operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend UInt8 <: ThrowingOp<UInt8>

extend UInt8 <: ThrowingOp<UInt8>

Description: Implements the ThrowingOp interface for UInt8.

Parent types:

func throwingAdd(UInt8)

public func throwingAdd(y: UInt8): UInt8

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: addition operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): UInt8

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt8: auto-decrement operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(UInt8)

public func throwingDiv(y: UInt8): UInt8

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: division operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): UInt8

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt8: auto-increment operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(UInt8)

public func throwingMod(y: UInt8): UInt8

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: modulo operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(UInt8)

public func throwingMul(y: UInt8): UInt8

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: multiplication operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): UInt8

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

  • UInt8: negation operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): UInt8

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt8: left shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): UInt8

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt8: right shift operation result

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(UInt8)

public func throwingSub(y: UInt8): UInt8

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: subtraction operation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

extend UIntNative <: ThrowingOp<UIntNative>

extend UIntNative <: ThrowingOp<UIntNative>

Description: Implements the ThrowingOp interface for UIntNative.

Parent types:

func throwingAdd(UIntNative)

public func throwingAdd(y: UIntNative): UIntNative

Description: Performs an addition operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the addition operation, this exception is thrown.

func throwingDec()

public func throwingDec(): UIntNative

Description: Performs an auto-decrement operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-decrement operation, this exception is thrown.

func throwingDiv(UIntNative)

public func throwingDiv(y: UIntNative): UIntNative

Description: Performs a division operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the division operation, this exception is thrown.

func throwingInc()

public func throwingInc(): UIntNative

Description: Performs an auto-increment operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the auto-increment operation, this exception is thrown.

func throwingMod(UIntNative)

public func throwingMod(y: UIntNative): UIntNative

Description: Performs a modulo operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the modulo operation, this exception is thrown.

func throwingMul(UIntNative)

public func throwingMul(y: UIntNative): UIntNative

Description: Performs a multiplication operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the multiplication operation, this exception is thrown.

func throwingNeg()

public func throwingNeg(): UIntNative

Description: Performs a negation operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the negation operation, this exception is thrown.

func throwingShl(UInt64)

public func throwingShl(y: UInt64): UIntNative

Description: Performs a left shift operation using the exception throwing policy.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingShr(UInt64)

public func throwingShr(y: UInt64): UIntNative

Description: Performs a right shift operation.

If the number of bits to shift by is greater than or equal to that of operand bits, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

Throws:

  • OvershiftException: If the number of bits to shift by is greater than or equal to that of operand bits, this exception is thrown.

func throwingSub(UIntNative)

public func throwingSub(y: UIntNative): UIntNative

Description: Performs a subtraction operation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

Throws:

  • OverflowException: If an overflow/underflow occurs during the subtraction operation, this exception is thrown.

interface ThrowingPow

public interface ThrowingPow {
    public func throwingPow(y: UInt64): Int64
}

Description: Provides an interface for exponentiation using the exception throwing policy.

func throwingPow(UInt64)

public func throwingPow(y: UInt64): Int64

Description: Performs an exponentiation using the exception throwing policy.

If an overflow/underflow occurs during the operation, an exception is thrown. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: exponentiation result

Throws:

  • OverflowException: If an overflow/underflow occurs during the exponentiation, this exception is thrown.

interface WrappingOp<T>

public interface WrappingOp<T> {
    func wrappingAdd(y: T): T
    func wrappingDec(): T
    func wrappingDiv(y: T): T
    func wrappingInc(): T
    func wrappingMod(y: T): T
    func wrappingMul(y: T): T
    func wrappingNeg(): T
    func wrappingShl(y: UInt64): T
    func wrappingShr(y: UInt64): T
    func wrappingSub(y: T): T
}

Description: Truncates the most significant bits when an overflow/underflow occurs during an integer operation.

func wrappingAdd(T)

func wrappingAdd(y: T): T

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

  • y: T: addend

Returns:

  • T: addition operation result

func wrappingDec()

func wrappingDec(): T

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • T: auto-decrement operation result

func wrappingDiv(T)

func wrappingDiv(y: T): T

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

  • y: T: divisor

Returns:

  • T: division operation result

func wrappingInc()

func wrappingInc(): T

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • T: auto-increment operation result

func wrappingMod(T)

func wrappingMod(y: T): T

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

  • y: T: divisor

Returns:

  • T: modulo operation result

func wrappingMul(T)

func wrappingMul(y: T): T

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

  • y: T: multiplier

Returns:

  • T: multiplication operation result

func wrappingNeg()

func wrappingNeg(): T

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • T: negation operation result

func wrappingShl(UInt64)

func wrappingShl(y: UInt64): T

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits to shift by is greater than or equal to that of operand bits, the most significant bits are truncated. For example, y is the number of bits to shift by for an Int8 number. When y is greater than or equal to 8, only its least significant 3 bits determine the number of bits to shift by, ensuring that the number of bits to shift by ranges from 0 to 7.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • T: left shift operation result

func wrappingShr(UInt64)

func wrappingShr(y: UInt64): T

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits to shift by is greater than or equal to that of operand bits, the most significant bits are truncated. For example, y is the number of bits to shift by for an Int8 number. When y is greater than or equal to 8, only its least significant 3 bits determine the number of bits to shift by, ensuring that the number of bits to shift by ranges from 0 to 7.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • T: right shift operation result

func wrappingSub(T)

func wrappingSub(y: T): T

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

  • y: T: subtrahend

Returns:

  • T: subtraction operation result

extend Int16 <: WrappingOp<Int16>

extend Int16 <: WrappingOp<Int16>

Description: Implements the WrappingOp interface for Int16.

Parent types:

func wrappingAdd(Int16)

public func wrappingAdd(y: Int16): Int16

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: addition operation result

func wrappingDec()

public func wrappingDec(): Int16

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int16: auto-decrement operation result

func wrappingDiv(Int16)

public func wrappingDiv(y: Int16): Int16

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: division operation result

func wrappingInc()

public func wrappingInc(): Int16

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int16: auto-increment operation result

func wrappingMod(Int16)

public func wrappingMod(y: Int16): Int16

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: modulo operation result

func wrappingMul(Int16)

public func wrappingMul(y: Int16): Int16

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: multiplication operation result

func wrappingNeg()

public func wrappingNeg(): Int16

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int16: negation operation result

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): Int16

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 4 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int16: left shift operation result

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): Int16

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 4 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int16: right shift operation result

func wrappingSub(Int16)

public func wrappingSub(y: Int16): Int16

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int16: subtraction operation result

extend Int32 <: WrappingOp<Int32>

extend Int32 <: WrappingOp<Int32>

Description: Implements the WrappingOp interface for Int32.

Parent types:

func wrappingAdd(Int32)

public func wrappingAdd(y: Int32): Int32

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: addition operation result

func wrappingDec()

public func wrappingDec(): Int32

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int32: auto-decrement operation result

func wrappingDiv(Int32)

public func wrappingDiv(y: Int32): Int32

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: division operation result

func wrappingInc()

public func wrappingInc(): Int32

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int32: auto-increment operation result

func wrappingMod(Int32)

public func wrappingMod(y: Int32): Int32

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: modulo operation result

func wrappingMul(Int32)

public func wrappingMul(y: Int32): Int32

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: multiplication operation result

func wrappingNeg()

public func wrappingNeg(): Int32

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int32: negation operation result

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): Int32

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 5 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int32: left shift operation result

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): Int32

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 5 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int32: right shift operation result

func wrappingSub(Int32)

public func wrappingSub(y: Int32): Int32

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int32: subtraction operation result

extend Int64 <: WrappingOp<Int64> & WrappingPow

extend Int64 <: WrappingOp<Int64> & WrappingPow

Description: Implements the WrappingOp and WrappingPow interfaces for Int64.

Parent types:

func wrappingAdd(Int64)

public func wrappingAdd(y: Int64): Int64

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: addition operation result

func wrappingDec()

public func wrappingDec(): Int64

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int64: auto-decrement operation result

func wrappingDiv(Int64)

public func wrappingDiv(y: Int64): Int64

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: division operation result

func wrappingInc()

public func wrappingInc(): Int64

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int64: auto-increment operation result

func wrappingMod(Int64)

public func wrappingMod(y: Int64): Int64

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: modulo operation result

func wrappingMul(Int64)

public func wrappingMul(y: Int64): Int64

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: multiplication operation result

func wrappingNeg()

public func wrappingNeg(): Int64

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int64: negation operation result

func wrappingPow(UInt64)

public func wrappingPow(y: UInt64): Int64

Description: Performs an exponentiation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: exponentiation result

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): Int64

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 6 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int64: left shift operation result

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): Int64

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 6 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int64: right shift operation result

func wrappingSub(Int64)

public func wrappingSub(y: Int64): Int64

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: subtraction operation result

extend Int8 <: WrappingOp<Int8>

extend Int8 <: WrappingOp<Int8>

Description: Implements the WrappingOp interface for Int8.

Parent types:

func wrappingAdd(Int8)

public func wrappingAdd(y: Int8): Int8

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int8: addition operation result

func wrappingDec()

public func wrappingDec(): Int8

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int8: auto-decrement operation result

func wrappingDiv(Int8)

public func wrappingDiv(y: Int8): Int8

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int8: division operation result

func wrappingInc()

public func wrappingInc(): Int8

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int8: auto-increment operation result

func wrappingMod(Int8)

public func wrappingMod(y: Int8): Int8

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int8: modulo operation result

func wrappingMul(Int8)

public func wrappingMul(y: Int8): Int8

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

  • y: Int8: multiplier

Returns:

  • Int8: multiplication operation result

func wrappingNeg()

public func wrappingNeg(): Int8

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • Int8: negation operation result

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): Int8

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 3 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int8: left shift operation result

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): Int8

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 3 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • Int8: right shift operation result

func wrappingSub(Int8)

public func wrappingSub(y: Int8): Int8

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

  • y: Int8: subtrahend

Returns:

  • Int8: subtraction operation result

extend IntNative <: WrappingOp<IntNative>

extend IntNative <: WrappingOp<IntNative>

Description: Implements the WrappingOp interface for IntNative.

Parent types:

func wrappingAdd(IntNative)

public func wrappingAdd(y: IntNative): IntNative

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

func wrappingDec()

public func wrappingDec(): IntNative

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

func wrappingDiv(IntNative)

public func wrappingDiv(y: IntNative): IntNative

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

func wrappingInc()

public func wrappingInc(): IntNative

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

func wrappingMod(IntNative)

public func wrappingMod(y: IntNative): IntNative

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

func wrappingMul(IntNative)

public func wrappingMul(y: IntNative): IntNative

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

func wrappingNeg()

public func wrappingNeg(): IntNative

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): IntNative

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant n (depending on the number of IntNative bits in the current environment) bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): IntNative

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant n (depending on the number of IntNative bits in the current environment) bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func wrappingSub(IntNative)

public func wrappingSub(y: IntNative): IntNative

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

extend UInt16 <: WrappingOp<UInt16>

extend UInt16 <: WrappingOp<UInt16>

Description: Implements the WrappingOp interface for UInt16.

Parent types:

func wrappingAdd(UInt16)

public func wrappingAdd(y: UInt16): UInt16

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: addition operation result

func wrappingDec()

public func wrappingDec(): UInt16

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt16: auto-decrement operation result

func wrappingDiv(UInt16)

public func wrappingDiv(y: UInt16): UInt16

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: division operation result

func wrappingInc()

public func wrappingInc(): UInt16

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt16: auto-increment operation result

func wrappingMod(UInt16)

public func wrappingMod(y: UInt16): UInt16

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: modulo operation result

func wrappingMul(UInt16)

public func wrappingMul(y: UInt16): UInt16

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: multiplication operation result

func wrappingNeg()

public func wrappingNeg(): UInt16

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt16: negation operation result

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): UInt16

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 4 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt16: left shift operation result

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): UInt16

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 4 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt16: right shift operation result

func wrappingSub(UInt16)

public func wrappingSub(y: UInt16): UInt16

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt16: subtraction operation result

extend UInt32 <: WrappingOp<UInt32>

extend UInt32 <: WrappingOp<UInt32>

Description: Implements the WrappingOp interface for UInt32.

Parent types:

func wrappingAdd(UInt32)

public func wrappingAdd(y: UInt32): UInt32

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: addition operation result

func wrappingDec()

public func wrappingDec(): UInt32

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt32: auto-decrement operation result

func wrappingDiv(UInt32)

public func wrappingDiv(y: UInt32): UInt32

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: division operation result

func wrappingInc()

public func wrappingInc(): UInt32

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt32: auto-increment operation result

func wrappingMod(UInt32)

public func wrappingMod(y: UInt32): UInt32

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: modulo operation result

func wrappingMul(UInt32)

public func wrappingMul(y: UInt32): UInt32

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: multiplication operation result

func wrappingNeg()

public func wrappingNeg(): UInt32

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt32: negation operation result

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): UInt32

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 5 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt32: left shift operation result

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): UInt32

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 5 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt32: right shift operation result

func wrappingSub(UInt32)

public func wrappingSub(y: UInt32): UInt32

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt32: subtraction operation result

extend UInt64 <: WrappingOp<UInt64>

extend UInt64 <: WrappingOp<UInt64>

Description: Implements the WrappingOp interface for UInt64.

Parent types:

func wrappingAdd(UInt64)

public func wrappingAdd(y: UInt64): UInt64

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: addition operation result

func wrappingDec()

public func wrappingDec(): UInt64

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt64: auto-decrement operation result

func wrappingDiv(UInt64)

public func wrappingDiv(y: UInt64): UInt64

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: division operation result

func wrappingInc()

public func wrappingInc(): UInt64

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt64: auto-increment operation result

func wrappingMod(UInt64)

public func wrappingMod(y: UInt64): UInt64

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: modulo operation result

func wrappingMul(UInt64)

public func wrappingMul(y: UInt64): UInt64

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: multiplication operation result

func wrappingNeg()

public func wrappingNeg(): UInt64

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt64: negation operation result

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): UInt64

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 6 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt64: left shift operation result

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): UInt64

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 6 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt64: right shift operation result

func wrappingSub(UInt64)

public func wrappingSub(y: UInt64): UInt64

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt64: subtraction operation result

extend UInt8 <: WrappingOp<UInt8>

extend UInt8 <: WrappingOp<UInt8>

Description: Implements the WrappingOp interface for UInt8.

Parent types:

func wrappingAdd(UInt8)

public func wrappingAdd(y: UInt8): UInt8

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: addition operation result

func wrappingDec()

public func wrappingDec(): UInt8

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt8: auto-decrement operation result

func wrappingDiv(UInt8)

public func wrappingDiv(y: UInt8): UInt8

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: division operation result

func wrappingInc()

public func wrappingInc(): UInt8

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt8: auto-increment operation result

func wrappingMod(UInt8)

public func wrappingMod(y: UInt8): UInt8

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: modulo operation result

func wrappingMul(UInt8)

public func wrappingMul(y: UInt8): UInt8

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: multiplication operation result

func wrappingNeg()

public func wrappingNeg(): UInt8

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

  • UInt8: negation operation result

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): UInt8

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 3 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt8: left shift operation result

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): UInt8

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant 3 bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

  • UInt8: right shift operation result

func wrappingSub(UInt8)

public func wrappingSub(y: UInt8): UInt8

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • UInt8: subtraction operation result

extend UIntNative <: WrappingOp<UIntNative>

extend UIntNative <: WrappingOp<UIntNative>

Description: Implements the WrappingOp interface for UIntNative.

Parent types:

func wrappingAdd(UIntNative)

public func wrappingAdd(y: UIntNative): UIntNative

Description: Performs an addition operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

func wrappingDec()

public func wrappingDec(): UIntNative

Description: Performs an auto-decrement operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

func wrappingDiv(UIntNative)

public func wrappingDiv(y: UIntNative): UIntNative

Description: Performs a division operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

func wrappingInc()

public func wrappingInc(): UIntNative

Description: Performs an auto-increment operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

func wrappingMod(UIntNative)

public func wrappingMod(y: UIntNative): UIntNative

Description: Performs a modulo operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

func wrappingMul(UIntNative)

public func wrappingMul(y: UIntNative): UIntNative

Description: Performs a multiplication operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

func wrappingNeg()

public func wrappingNeg(): UIntNative

Description: Performs a negation operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Returns:

func wrappingShl(UInt64)

public func wrappingShl(y: UInt64): UIntNative

Description: Performs a left shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant n (depending on the number of UIntNative bits in the current environment) bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func wrappingShr(UInt64)

public func wrappingShr(y: UInt64): UIntNative

Description: Performs a right shift operation using the policy of truncating the most significant bits.

If the number of bits of the right operand is greater than or equal to that of the left operand, the least significant n (depending on the number of UIntNative bits in the current environment) bits of the right operand determine the number of bits to shift by.

Parameters:

  • y: UInt64: number of bits to shift by

Returns:

func wrappingSub(UIntNative)

public func wrappingSub(y: UIntNative): UIntNative

Description: Performs a subtraction operation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

interface WrappingPow

public interface WrappingPow {
    public func wrappingPow(y: UInt64): Int64
}

Description: Provides an interface for exponentiation using the policy of truncating the most significant bits.

func wrappingPow(UInt64)

public func wrappingPow(y: UInt64): Int64

Description: Performs an exponentiation using the policy of truncating the most significant bits.

If an overflow/underflow occurs during the operation, the most significant bits are truncated. Otherwise, the operation result is returned.

Parameters:

Returns:

  • Int64: exponentiation result