Functions

The following functions are available globally.

  • SwifterSwift: Value of exponentiation.

    Declaration

    Swift

    public func ** (lhs: Int, rhs: Int) -> Double

    Parameters

    lhs

    base integer.

    rhs

    exponent integer.

    Return Value

    exponentiation result (example: 2 ** 3 = 8).

  • SwifterSwift: Square root of integer.

    Declaration

    Swift

    public prefix func  (int: Int) -> Double

    Parameters

    int

    integer value to find square root for

    Return Value

    square root of given integer.

  • SwifterSwift: Tuple of plus-minus operation.

    Declaration

    Swift

    public func ± (lhs: Int, rhs: Int) -> (Int, Int)

    Parameters

    lhs

    integer number.

    rhs

    integer number.

    Return Value

    tuple of plus-minus operation (example: 2 ± 3 -> (5, -1)).

  • SwifterSwift: Tuple of plus-minus operation.

    Declaration

    Swift

    public prefix func ± (int: Int) -> (Int, Int)

    Parameters

    int

    integer number

    Return Value

    tuple of plus-minus operation (example: ± 2 -> (2, -2)).

  • SwifterSwift: Value of exponentiation.

    Declaration

    Swift

    public func ** (lhs: Float, rhs: Float) -> Float

    Parameters

    lhs

    base float.

    rhs

    exponent float.

    Return Value

    exponentiation result (4.4 ** 0.5 = 2.0976176963).

  • SwifterSwift: Square root of float.

    Declaration

    Swift

    public prefix func  (float: Float) -> Float

    Parameters

    float

    float value to find square root for

    Return Value

    square root of given float.

  • SwifterSwift: Value of exponentiation.

    Declaration

    Swift

    public func ** (lhs: Double, rhs: Double) -> Double

    Parameters

    lhs

    base double.

    rhs

    exponent double.

    Return Value

    exponentiation result (example: 4.4 ** 0.5 = 2.0976176963).

  • SwifterSwift: Square root of double.

    Declaration

    Swift

    public prefix func  (double: Double) -> Double

    Parameters

    double

    double value to find square root for.

    Return Value

    square root of given double.

  • SwifterSwift: Tuple of plus-minus operation.

    Declaration

    Swift

    public func ±<T: FloatingPoint> (lhs: T, rhs: T) -> (T, T)

    Parameters

    lhs

    number

    rhs

    number

    Return Value

    tuple of plus-minus operation ( 2.5 ± 1.5 -> (4, 1)).

  • SwifterSwift: Tuple of plus-minus operation.

    Declaration

    Swift

    public prefix func ±<T: FloatingPoint> (number: T) -> (T, T)

    Parameters

    int

    number

    Return Value

    tuple of plus-minus operation (± 2.5 -> (2.5, -2.5)).