Functions

The following functions are available globally.

Public Functions

  • Returns the result of adding left to right.

    Declaration

    Swift

    public func + (left: NSDecimalNumber, right: NSDecimalNumber) -> NSDecimalNumber

    Parameters

    left

    The left operand

    right

    The right operand

    Return Value

    The result

  • Adds left to right and assigns the result to left.

    Declaration

    Swift

    public func += (left: inout NSDecimalNumber, right: NSDecimalNumber)

    Parameters

    left

    The left operand

    right

    The right operand

  • Returns the result of subtracting right from right.

    Declaration

    Swift

    public func - (left: NSDecimalNumber, right: NSDecimalNumber) -> NSDecimalNumber

    Parameters

    left

    The left operand

    right

    The right operand

    Return Value

    The result

  • Subtracts right from left and assigns the result to left.

    Declaration

    Swift

    public func -= (left: inout NSDecimalNumber, right: NSDecimalNumber)

    Parameters

    left

    The left operand

    right

    The right operand

  • Returns the result of multiplying left by right.

    Declaration

    Swift

    public func * (left: NSDecimalNumber, right: NSDecimalNumber) -> NSDecimalNumber

    Parameters

    left

    The left operand

    right

    The right operand

    Return Value

    The result

  • Multiplies left by right and assigns the result to left.

    Declaration

    Swift

    public func *= (left: inout NSDecimalNumber, right: NSDecimalNumber)

    Parameters

    left

    The left operand

    right

    The right operand

  • Returns the result of dividing left by right.

    Declaration

    Swift

    public func / (left: NSDecimalNumber, right: NSDecimalNumber) -> NSDecimalNumber

    Parameters

    left

    The left operand

    right

    The right operand

    Return Value

    The result

  • Divides left by right and assigns the result to left.

    Declaration

    Swift

    public func /= (left: inout NSDecimalNumber, right: NSDecimalNumber)

    Parameters

    left

    The left operand

    right

    The right operand

  • Returns the minimum value of left and right.

    Declaration

    Swift

    public func min(_ left: NSDecimalNumber, _ right: NSDecimalNumber) -> NSDecimalNumber

    Parameters

    left

    The left operand

    right

    The right operand

    Return Value

    left if left is less than right, otherwise right

  • Returns the maximum value of left and right.

    Declaration

    Swift

    public func max(_ left: NSDecimalNumber, _ right: NSDecimalNumber) -> NSDecimalNumber

    Parameters

    left

    The left operand

    right

    The right operand

    Return Value

    left if left is greater than right, otherwise right

  • Invokes the provided block and returns the result.

    let retval = run {
       // do stuff and return a value
    }
    

    Declaration

    Swift

    @inlinable
    @inline(__always)
    public func run<T>(_ block: () -> T) -> T

    Parameters

    block

    The block to invoke

    Return Value

    The result of invoking block